Statalist The Stata Listserver


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

Re: st: Confidence intervals for predictions after GLMs


From   Steven Samuels <[email protected]>
To   [email protected]
Subject   Re: st: Confidence intervals for predictions after GLMs
Date   Fri, 15 Jun 2007 15:00:50 -0400

Redundant Line

Allan is referring to the fact that -predictnl- returns confidence intervals (CI's) that are symmetrical about the predicted value. Allan would prefer that -predictnl- compute asymmetric intervals: predict the linear function,, compute the SE of this function, estimate CI's for the linear function, and then invert the CI endpoints. This process will produce a "better" interval then that produced by -predictnl-; for example the inverted interval will more closely match one obtained by the bootstrap.

However I agree with Stata Support: Alan is wrong to expect this behavior from -predictnl-. It ts such a general command that it computes a standard error & CI for functions in which there is NO invertible linear form.
For example: predictnl p2 = _b[weight]*weight/_b[height]*height


I would not expect -predictnl- to diagnose the RHS expression to determine if it contains an invertible linear form. However it is reasonable to ask StataCorp to add options to -predict- to compute the inverted CI after commands like -logistic-, where -predict- inverts a linear form to obtain the estimated probability.

-Steve



On Jun 15, 2007, at 11:17 AM, Allan Reese ((Cefas)) wrote:


Stata boasts many commands for estimation following model fits, so it was a surprise to find a gap for generalized linear models (glm's). Point estimates are available through predict, but the confidence interval from predictnl is clearly wrong when the error distribution has been specified as non-normal.

I've raised this with Tech Desk, using a simple example with well- known data:
. use auto
. logit foreign weight
. predict mu
-----Tech desk Message-----
The issue here is that -predictnl- is a very flexible command that will allow you to create various types of nonlinear predictions. In the command you used

predictnl mu2= exp( _b[_cons] + _b[weight]*weight ) /
( 1 + exp( _b[_cons] + _b[weight]*weight) ), ci(lo hi)

[inverse link for a logit example]

we know that _b[_cons] + _b[weight]*weight follows a normal distribution. However, -predictnl- has no way of discerning this or knowing that this particular nonlinear combination creates a predicted probability. All confidence intervals created by - predictnl- are based on the nonlinear combination being asymptotically normal which is fine even in the case of the nonlinear expression that you used above. The difference in this case is that we know that this is a predicted probability and can create a more precise confidence interval manually transforming the endpoints of the confidence interval for xb.

Thus, there is not a problem with the confidence intervals that - predictnl- creates for nonlinear functions. However, in certain cases there may be a more direct way to calculate the intervals that is not based on asymptotic normality. This is true in your situation.
--------------------------

Would you be happy with an "asymptotic" approach? I don't follow, as the error distribution doesn't change and this is for individual predictions. Asymptotic with respect to what? As I read it, they are claiming that *any* function can have a CI predicted as if it is normal, even when it is explicitly a transformation of a normal variate!

The GLM approach is well-defined: the linear predictor is a combination of weighted parameter estimates, so has a normal distribution. Define the CI for the linear predictor, then back- transform using the inverse-link function. This must be done by predict when evaluating the mean.

Are other users being misled by this approximate approach to CIs?
Allan






********************************************************************** *************
This email and any attachments are intended for the named recipient only. Its unauthorised use, distribution, disclosure, storage or copying is not permitted. If you have received it in error, please destroy all copies and notify the sender. In messages of a non- business nature, the views and opinions expressed are the author's own and do not necessarily reflect those of the organisation from which it is sent. All emails may be subject to monitoring.
********************************************************************** *************


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