| From | "Nick Cox" <n.j.cox@durham.ac.uk> |
| To | <statalist@hsphsun2.harvard.edu> |
| Subject | RE: st: RE: RE: Data manipulation question |
| Date | Thu, 29 Jul 2004 13:08:04 +0100 |
Very neat indeed! Nick n.j.cox@durham.ac.uk Edwin Leuven > Nick Cox wrote: > > Here is another way to do it. > > and another: > > expand ccode - cond(ccode[_n-1]==.,0,ccode[_n-1]) > bysort ccode: replace weight = 0 if _n<_N > replace cc = _n > * * 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/