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]

From |
"Y.R.E. Retamal" <[email protected]> |

To |
[email protected] |

Subject |
Re: st: predicting height by age for each individual |

Date |
Thu, 30 Jan 2014 17:01:36 +0000 |

Dear Maarten

replace xb=xb2 if id==2 drop xb2 putting the predicted values for id==1 and id==2 in just one variable. I would like to automatize all this procedure. I hope have been clearer Rodrigo On 2014-01-30 15:47, Maarten Buis wrote:

I have two comments: As a father I can tell you that height does not change linearly with age in that period. You might want to look at -fp- in order to create a reasonable model. Imangine what happens in your code when you have three persons. Your first regression will fill in for person 2 and 3, your second regression will be used to fill in 1 and 3, but wait.. you already filled in for person 3. What do you want to do in that case? -- MaartenOn Thu, Jan 30, 2014 at 4:26 PM, Y.R.E. Retamal <[email protected]>wrote:Dear STATA usersI am studying growth and development in children from 0 to 3 yearsold. I amusing 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 threeyearsold for each six months (birth, 6, 12, 18, ..., 36 month), afterrunning alinear regression of height by age for each child, not all at the sametime.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 commandspereach child (1600 times), something truly inefficient and tedious.There is acommand 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/-- --------------------------------- Maarten L. Buis WZB Reichpietschufer 50 10785 Berlin Germany http://www.maartenbuis.nl --------------------------------- * * 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/

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

**References**:**st: WTP distribution with LN Cost coefficient***From:*"Heidi Pitts" <[email protected]>

**st: predicting yhat of height for each individual at different ages***From:*"Y.R.E. Retamal" <[email protected]>

**st: predicting height by age for each individual***From:*"Y.R.E. Retamal" <[email protected]>

**Re: st: predicting height by age for each individual***From:*Maarten Buis <[email protected]>

- Prev by Date:
**st: graph bar, over() with overall mean** - Next by Date:
**Re: st: graph bar, over() with overall mean** - Previous by thread:
**Re: st: predicting height by age for each individual** - Next by thread:
**st: -eclplot- and multiline labels** - Index(es):