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: predicting height by age for each individual
From
"Y.R.E. Retamal" <[email protected]>
To
[email protected]
Subject
st: predicting height by age for each individual
Date
Thu, 30 Jan 2014 15:26:13 +0000
Dear STATA users
I am studying growth and development in children from 0 to 3 years old.
I am using a longitudinal database of children where height and weight
were measured from birth to three years old (1600 children).
I would like to predict height of each child from birth until three
years old for each six months (birth, 6, 12, 18, ..., 36 month), after
running a linear regression of height by age for each child, not all at
the same time.
For example, I have the following database:
id month height
1 0 59
1 6 68
1 12 70
1 18 74
1 24 81
1 30 86
1 36 94
2 0 50
2 6 55
2 12 74
2 18 80
2 24 82
2 30 87
2 36 95
I could do:
reg height month if id==1
predict xb if id!=1
reg height month if id==2
predict xb if id!=2
and so...
But, I have 1600 children, therefore I should write the same commands
per each child (1600 times), something truly inefficient and tedious.
There is a command or program to run the same commands, but
automatically?
Any help would be very appreciated.
Rodrigo
*
* 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/