Alvine wrote:
Thank you for your help, but the number of measurement is different from
patient to patient. So I need to get the maximum value of measurement:
egen max_mes=max(nb_mes)
And then use
forvalues i=1/`max_mes' {
...
----------------------------------------------
No; -forvalues- needs a constant. If you know that
the patient with most measurements has 97 measurements,
the command is:
forvalues i=2/97 {
For all patients this creates the variables diff2-diff97,
but for the patient with three measurements, diff4-diff92
have missing values. And that is how it should be.
Hope this helps
Svend
__________________________________________
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000 Aarhus C, Denmark
Phone: +45 8942 6090
Home: +45 8693 7796
Email: [email protected]
__________________________________________
*
* 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/