Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: saved results

From   Thomas Masterson <>
Subject   Re: st: saved results
Date   Mon, 14 May 2007 20:51:32 -0400

Try this:

su id
forval i = 1(1)`r(max)' {
 regress outcome time if id==`i'
 predict xb if id==`i'


Andy Choi wrote:
I am calculating rates of change using the following
command, where id is the unique identifier for an
individual with repeated measurements on the outcome
over time:

by id: regress outcome time

I would like to obtain saved estimates for each
individual, namely the beta coefficient for each
regression. I tried to obtain the regression results
for each individual with:

predict xb

But this will only predict based on the last
regression (for the last person in the data set). Unfortunately, "by id: predict xb" is not an option.

Any suggestion on how I can obtain the beta
coefficient for each individual?

____________________________________________________________________________________Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search
* For searches and help try:
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index