Am 23.07.2014 um 16:24 schrieb Allin Cottrell:
We could work on offering more, but in the meantime you can use the
p*
functions to construct a suitable dataset yourself, as in
<hansl>
open abdata.gdt
panel n 0 ys --between
matrix bn = pshrink(pmean(n))
matrix bys = pshrink(pmean(ys))
N = rows(bn)
nulldata N --preserve
series n = bn
series ys = bys
ols n 0 ys
omit ys
</hansl>
Just for future reference, an alternative way would be to exploit the
fact that 'pmean()' stores the values repeatedly in all time periods so
one could just pick the first time period and then run the regression
without leaving the original workfile:
<hansl>
open abdata.gdt
panel n 0 ys --between # just for comparison
series ave_n = pmean(n)
series ave_ys = pmean(ys)
genr time
smpl time==1 --restrict
ols ave_n 0 ave_ys # can also use --robust here
omit ave_ys
</hansl>
BTW, it would seem natural to extend pmean() (and the other p*
functions) to accept lists just like diff(), ldiff(), lags() etc.
The template for naming the created series could be 'pm_varname' or
somesuch.
cheers,
sven