That surprises me. However, Stata does not
act to minimise my surprise. Are you
sure you are typing exactly what was
suggested, as it works for me?
Nick
[email protected]
Alexander Nervedi
> I get the error message "time-series operators not
> allowed". i have tsset
> set - i dont think thats necessary to use this is it ?
Nick Cox
> >bysort ID (year) : gen cusum = _N - _n + 1
Alexander Nervedi
> > > I am looking to implement a group level cumulative sum that
> > > starts counting
> > > backwards. Any suggestions on how to go about this would be
> > > really useful
> > >
> > > data example:
> > > ID year num cusum
> > > 1 90 1 2
> > > 1 91 1 1
> > > 2 90 1 4
> > > 2 91 1 3
> > > 2 92 1 2
> > > 2 93 1 1
> > > 3 90 1 1
> > > 4 90 1 2
> > > 4 90 1 1
> > > ...
> > >
> > > I have variables ID year and num, and am trying to create cusum
*
* 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/