Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: predicted probabily at different values of time


From   rowa0068@umn.edu
To   statalist@hsphsun2.harvard.edu
Subject   st: predicted probabily at different values of time
Date   14 Oct 2012 17:28:19 -0500

Hi,

I'm using Stata 12 and am trying to get the predicted probability of an outcome at each of 6 time points (time is a continuous variable), on imputed data. I am looping over categories of insurance, and time is my predictor of interest:

forvalues i = 0/2 {
mi estimate, dots esampvaryok saving(miestim_acc_modi`i', replace): ///
   svy, subpop(if.... insurcatr ==`i'): logit sawmentr time i.raceb....etc
}
Then I try to get the predicted value for my outcome for each insurance group.
forvalues i= 0/2 {
mi predict xb_mi`i' if insurcatr ==`i' using miestim_acc_modi`i'
generate predinsmod`i' = invlogit(xb_mi`i')
}

But this does not seem right; I'd like predictions of my outcome at each time point, but the predicted value from above is at the means of all my predictors, correct? Would I have to run 6 regressions to create 6 ".ster" data sets for each time point, and use "mi predict" for each data set?

But a broader question is can I specify values of the prediction, as the margins command allows you to do? Margins will not work on imputed data, the program I found on a help site was cool but didn't seem to work (http://www.stata.com/statalist/archive/2010-03/msg01021.html). I'm also not clear margins are what I want for a continuous variable.

Thanks, Kath


--

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index