In a panel, I guess the second -replace- should
be -by id:- also. Otherwise _N has the interpretation
of the number of observations in the dataset, not
in each panel.
Nick
[email protected]
Scott Merryman
> bysort id (t): gen foo = sum(abs((pip - l.pip)/l.pip))
> replace foo = . if t < t[_N -2]
[email protected]
> > Given a variable (taken from a set of n variables in a
> panel), called
> > "Pippo", I need to compute the following formula:
> >
> > Somma_(i=t-2 to t) of Absolute_value[(Pippo(i) -
> Pippo(i-1))/Pippo(i-1)]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/