Bookmark and Share

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]

Re: st: Formula for standard error of predicted probability in logit model


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: Formula for standard error of predicted probability in logit model
Date   Sun, 18 Aug 2013 10:17:45 +0200

On Fri, Aug 16, 2013 at 9:44 PM, Sam Lucas wrote:
> I have found many references to the multiple ways one can calculate a
> predicted probability from a logit model in stata (and in programs
> varying from excel to R).  What I have been unable to find is the
> formula stata uses to calculate the standard error of the predicted
> value estimate.

The delta method is a popular way of doing so. A brief discussion
(with references) can be found here:
http://www.stata.com/support/faqs/statistics/delta-method/

To get predicted probabilities after a logistic regression we apply
the -invlogit()- transformation to the linear predictor. We also have
the standard error of that linear predictor. With the delta method we
approximate the standard error of the predicted probability by
multiplying the standard error of the linear predictor with the first
derivative of the -invlogit()- transformation with respect to the
linear predictor (xb), which is invlogit(xb)*invlogit(-xb). In the
example below you can see that the result corresponds with what
-predictnl- does.

*------------------ begin example ------------------
// estimate a logit model
sysuse nlsw88, clear
gen byte goodjob = inlist(occupation,1,2) ///
    if occupation < .
logit union goodjob##collgrad

// let Stata do the delta method
predictnl pr = invlogit(xb()), se(se)

// do it ourself
predict double xb, xb
predict double se_lin ,stdp
gen double se2 = invlogit(xb)*invlogit(-xb)*se_lin

// compare the two
tab se se2
*------------------- end example -------------------
* (For more on examples I sent to the Statalist see:
* http://www.maartenbuis.nl/example_faq )

Hope this helps,
Maarten

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index