/*** Sorry I needed to modify to tag`X'[_n] **/
Dear Stata-listers,
I have an observation to make, I have a data set that is sorted by site,
subject and rnum and I am always creating / manipulating variables at the
subject level (rnum=1,..,20), as follows
/*** 1st run **/
sort site subject rnum
forval X = 1/6 {
genl prevcheck`X'=moa`X'[_n-1] if tag`X'[_n]==1
}
/*** 2nd run **/
sort site subject rnum
forval X = 1/6 {
genl prevcheck`X'=moa`X'[_n-1] if tag`X'[_n]==1 , by(site subject)
}
The variables prevcheck1-prevcheck6 were identical from the two runs - can I
trust that "by(site subject)" will always be redundant once Stata registers
the sorting structure.
Many thanks for your thoughts in advance.
Amani
*
* 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/
*
* 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/