Thank you very much Kieran! This appears to be working correctly. One
issue though. There are some individuals for which they have missing
values for the variables in the foreach statement. This only occurs in
the first record for certain individuals. After going through your code
line by line, it appears to happen after the foreach statement and I'm
not sure if I understand why this is occurring when there should be
valid values.
foreach var of varlist dual_15_85_12mth va_pcnt dual_15_85_claims
cross_over {
by study_id: replace `var' = `var'[_n+1]
}
Tom Weichle
Math Statistician
Center for Management of Complex Chronic Care (CMC3)
Hines VA Hospital, Bldg 1, C202
708-202-8387 ext. 24261
Thomas.Weichle@va.gov
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/