Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Kieran McCaul <kieran.mccaul@uwa.edu.au> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | st: RE: snapsan command |
Date | Sun, 20 May 2012 09:52:25 +0800 |
... Following on from Nick's comments: 1. You should probably read the documentation on -snapspan- and make sure that your data is indeed "snapshot" data. In particular, since you have reshaped your data prior to running -snapspan-, ensure that the reshaped data correctly places your variables and the time when they were measured on the same record. 2. The reason that your variables have missing values for the first record after you run -snapspan- is illustrated by the example in the -snapspan- help file, but is does require you to understand how time-span data differs from snapshot data. 3. You have to -stset- the data prior to running -stcox-. Try the example in the -snapspan- help file, but include some -stset- commands. For example: webuse snapspan, clear list, sepby(id) snapspan id time event list, sepby(id) * -stset- the data stset time, f(event) id(id) list, sepby(id) * or try -snapspan- using the generate() option webuse snapspan, clear list, sepby(id) snapspan id time event, generate(time0) * -stset- the data stset time, f(event) id(id) list, sepby(id) * -stset- the data but this time use the time0 variable stset time, f(event) id(id) enter(time0) list, sepby(id) -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of sara bonfanti Sent: Saturday, 19 May 2012 5:05 PM To: statalist@hsphsun2.harvard.edu Subject: st: snapsan command Dear Stata users, I'm stuck with my work beacuse of these problems. I'm using STATA 12.1. In order to run a cox regression (stcox) I have reshaped my dataset form wide to long and, then, I have run the command "snapsan". I wonder: 1) why, after running the command "snapsan", I get for each individual a first row (corresponding to the first year of my longitudinal database, i.e. 1997) of missing values except for the event variable. Reading the stata manual it seems a correct output but I don´t know how to deal with these missing values later on, when I work on my variables. 2) if it´s necessary to specify the option "generate(newt0var)". I have found it on manuals, but still I don´t understand how it works, and why I should use it. Thanks sara * * 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/