open abdata.gdt list X = w k ys # list of explanatory variables ### built-in method panel n const X --fixed-effects ### recentering "by hand" depvar = n - pmean(n) + mean(n) # redefine the dependent variable list indepvars = const loop foreach i X # redefine the explanatory variables x_$i = $i - pmean($i) + mean($i) indepvars += x_$i endloop ols depvar indepvars # perform estimation ### using centered dummies list C = dummify(unit) # create the unit dummies smpl n X --no-missing # adjust to perform centering correctly list D = stdize(C, -1) # center the unit dummies ols n const X D # perform estimation