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

From |
Larraine Becker <lbecker@unimelb.edu.au> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: RE: Output summary stats before doing other iteration |

Date |
Fri, 12 Sep 2008 16:41:06 +1000 |

Just a correction, the program below is
wrong…it should be: forvalues i=1(1)10 { use "U:\CS\combined
dataset_2006.dta", clear generate random`i' =
uniform() sort anyprevcs random`i' generate dropouts = 0 replace dropouts =1 if
anyprevcs==1 & (_N - _n) < 3575 logit
…….(I’ve deleted the variables, as there are too many to put
here!) replace anyprevcs=0 if
dropouts==1 predict onehat`i' summarize onehat`i' drop dropouts n }
Hi all, I’m doing 1000 iterations of a logistic
regression. I have to output the predicted value each time before it
carries on with the next iteration, otherwise I lose the first 999 predicted values! I’m sure there is a
way to go about this, but how can I save the predicted value each time so I end
up with a table with 1000 predicted values? My program is as follows: forvalues i=1(1)10 { use "U:\CS\combined
dataset_2006.dta", clear generate random`i' =
uniform() sort anyprevcs random`i' generate dropouts = 0 replace dropouts =1 if
anyprevcs==1 & (_N - _n) < 3575 logit
…….(I’ve deleted the variables, as there are too many to put
here!) replace anyprevcs=0 if
dropouts==1 predict onehat`i' summarize onehat`i' gen n=_n egen predicted`i'=mean(onehat`i')*n drop dropouts n } Thanks, Larraine |

**Follow-Ups**:**Re: st: RE: Output summary stats before doing other iteration***From:*"Eva Poen" <eva.poen@gmail.com>

**References**:**st: Output summary stats before doing other iteration***From:*Larraine Becker <lbecker@unimelb.edu.au>

- Prev by Date:
**st: Output summary stats before doing other iteration** - Next by Date:
**st: RE: Output summary stats before doing other iteration** - Previous by thread:
**st: Output summary stats before doing other iteration** - Next by thread:
**Re: st: RE: Output summary stats before doing other iteration** - Index(es):

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