Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: RE: stsplit for for data with multiple records per subject


From   "Kieran McCaul" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RE: stsplit for for data with multiple records per subject
Date   Thu, 24 Dec 2009 05:28:36 +0800

...


OK, as an alternative, drop the variables that go in the -foreach- loop.

Then instead, -sort- the data on study_id and _t0 and save it.

Then go back to the original data, -keep- the study_id, dx_to_claim_day,
and all the variables that would have been in the -foreach- loop.
Rename dx_to_claim_day to _t0, -sort- the data on study_id and _t0 and
save it.

Now -merge- the two data sets on study_id and _t0.


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Weichle,
Thomas
Sent: Thursday, 24 December 2009 3:29 AM
To: [email protected]
Subject: st: RE: RE: stsplit for for data with multiple records per
subject

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
[email protected] 

*
*   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/


*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index