Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: predict after svy logit


From   [email protected]
To   [email protected]
Subject   Re: st: predict after svy logit
Date   Wed, 15 Jun 2005 11:49:34 -0500

One way to get around this until it is fixed would be replace the 
predictions 
with :

replace temp2 = cond(temp2>0 ,1/(1+exp(-temp2)), exp(-temp2)/(1+exp(-
temp2)))


Now, running this program gives the same output:

version 8.0
qui svyset [pweight=patwt], psu(psum) strata(stratm2)   
qui svylogit y x
predict double temp 

version 9.0
qui svyset  psum [pweight=patwt],  strata(stratm2)
qui  svy : logit y x 
predict double temp2
replace temp2 = cond(temp2>0 ,1/(1+exp(-temp2)), exp(-temp2)/(1+exp(-
temp2)))

compare temp temp2
 

                                        ---------- difference ---------
-
                            count       minimum      average     
maximum
-----------------------------------------------------------------------
-
temp=temp2                    100
                       ----------
jointly defined               100             0            0           
0
                       ----------
total                         100



Scott

----- Original Message -----
From: "Schonlau, Matthias" <[email protected]>
Date: Wednesday, June 15, 2005 9:42 am
Subject: st: predict after svy  logit

> Dear stata listers: 
> 
> In version 9, When I use predict after " svy: logit" the predicted 
> probabilities range from roughly 0.8 to greater than 2.0.  I don't 
> understand this. When predicting in Version 8.0 (under version 
> control) I get predictions that are credible. The survey logistic 
> regression give the same coefficients for both version 8.0 and 
> version 9.0 , the problem is only the prediction. 
> 
> Below an example with partial output. Any suggestions ?
> 
> Thanks, 
> 
> Matt 
>
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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