|Confidence intervals for predicted probabilities after probit
|William Sribney, StataCorp
. sysuse auto . probit foreign weight mpg . predict phat
The variable phat contains the predicted probabilities for each observation.
. predict ihat, xb
creates the variable ihat containing the linear predictor (x*beta) for each observation.
. predict error, stdp
creates the variable error containing the standard error of the linear predictor for each observation.
Since predict gives the standard error of the linear predictor, to compute confidence intervals for the predicted probabilities, you must first compute confidence intervals for the linear predictor, and then transform them to probability space.
Here is how to compute 95% confidence intervals:
. generate lb = ihat - invnormal(0.975)*error . generate ub = ihat + invnormal(0.975)*error . generate plb = normal(lb) . generate pub = normal(ub)
The variables plb and pub contain, respectively, the lower and upper confidence bounds for the predicted probabilities.
You can compute the standard error of the predicted probabilities by the following formula:
. generate pr_err = error*exp(-0.5*ihat^2)/sqrt(2*_pi)
This is a Taylor-series approximation for the standard error. It should NOT be used to generate confidence intervals. Normality holds much better on the index scale than on the probability scale. Thus it is much better to compute the confidence interval for the index and then transform the endpoints to probability space (as we did above) than it is to use the approximate standard errors of the predicted probabilities to compute confidence intervals.
A similar problem about logistic regression is discussed in FAQ: How do I obtain confidence intervals for the predicted probabilities after logistic regression?
Classroom and web training
Teaching with Stata
Statalist: The Stata Forum
Last updated: 16 November 2022
StataCorp LLC (StataCorp) strives to provide our users with exceptional products and services. To do so, we must collect personal information from you. This information is necessary to conduct business with our existing and potential customers. We collect and use this information only where we may legally do so. This policy explains what personal information we collect, how we use it, and what rights you have to that information.
These cookies are essential for our website to function and do not store any personally identifiable information. These cookies cannot be disabled.
Please note: Clearing your browser cookies at any time will undo preferences saved here. The option selected here will apply only to the device you are currently using.