Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Create baseline variable within panel data


From   Nikolaos Pandis <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Create baseline variable within panel data
Date   Sat, 20 Jul 2013 13:44:41 -0700 (PDT)

Dear all,

I have 5 observations per patient which indicate outcome measurements at 5 different time points including baseline.
I have reshaped my data long and I would like to generate a new variable which is populated for each patient id (5 instances) with the baseline outcome value (yi1) as shown below:

id outcome time  new_var

1   y11      1     y11
1   y12      2     y11 
1   y13      3     y11
1   y14      4     y11
1   y15      5     y11
2   y21      1     y21
2   y22      2     y21
2   y23      3     y21
2   y24      4     y21
2   y25      5     y21 
3.........................

Any help would be appreciated.
Thank you,
Nick    

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index