Group Abstract Group Abstract

Message Boards Message Boards

Get prediction intervals of parameters on GLM Binomial models?

Posted 7 years ago

Using Binomial data we need to determine predicational intervals on x at specific probabilities (Y). Enclosed is code that produces a visual representation of example fitted data but not the + and - 95% prediction values of x. The image of the plot (copy included) indicates the two points we need to determine.

Attachment

Attachments:
POSTED BY: Terry Acree
5 Replies
Posted 7 years ago

I think what you want are confidence intervals for $x$ given some probability $p$ (not prediction or predictional intervals - and I don't know what predictional intervals are).

Because the model you're fitting is

$$\log \left(\frac{\text{prob}}{1-\text{prob}}\right)=a+b x$$

you want confidence intervals for $x$

$$x = \frac{\log \left(\frac{\text{prob}}{1-\text{prob}}\right)-a}{b}$$

You can get the lower and upper limits for a 95% confidence interval for $x$ with the following:

prob = 0.5;
upper= tt /. Solve[prob == 1 - 1/(1 + Exp[parms.{1, tt} - 1.96 Sqrt[{1, tt}.cov.{1, tt}]]), tt]
lower= tt /. Solve[prob == 1 - 1/(1 + Exp[parms.{1, tt} + 1.96 Sqrt[{1, tt}.cov.{1, tt}]]), tt]
POSTED BY: Jim Baldwin

hello Bill

You hit the nail on the head I am having problems with language, as my parameter-variable faux-pax made clear. I have included a copy of the data I used to generate the plot. A glance will make it clear that it is a Binomial (n=12) data set and not Bernoulli. The column on the left is the predictor variable tested 12 times for each value of x and the column on the right is the response variable y. Or am I mistaken. { {2.69897, 1.}, {2.69897, 1.}, {2.69897, 1.}, {2.69897, 1.}, {2.69897, 1.}, {2.69897, 1.}, {2.69897, 1.}, {2.69897, 1.}, {2.69897, 1.}, {2.69897, 1.}, {2.69897, 1.}, {2.69897, 1.}, {2., 1.}, {2., 1.}, {2., 1.}, {2., 1.}, {2., 1.}, {2., 1.}, {2., 1.}, {2., 1.}, {2., 1.}, {2., 1.}, {2., 1.}, {2., 1.}, {1.69897, 1.}, {1.69897, 1.}, {1.69897, 1.}, {1.69897, 1.}, {1.69897, 1.}, {1.69897, 1.}, {1.69897, 1.}, {1.69897, 1.}, {1.69897, 1.}, {1.69897, 1.}, {1.69897, 1.}, {1.69897, 1.}, {1., 1.}, {1., 1.}, {1., 1.}, {1., 1.}, {1., 1.}, {1., 1.}, {1., 1.}, {1., 1.}, {1., 1.}, {1., 1.}, {1., 1.}, {1., 1.}, {0.69897, 1.}, {0.69897, 1.}, {0.69897, 1.}, {0.69897, 1.}, {0.69897, 1.}, {0.69897, 1.}, {0.69897, 1.}, {0.69897, 1.}, {0.69897, 1.}, {0.69897, 1.}, {0.69897, 1.}, {0.69897, 1.}, {0., 0.}, {0., 0.}, {0., 0.}, {0., 0.}, {0., 0.}, {0., 0.}, {0., 0.}, {0., 1.}, {0., 1.}, {0., 1.}, {0., 1.}, {0., 1.}, {-0.30103, 0.}, {-0.30103, 0.}, {-0.30103, 0.}, {-0.30103, 0.}, {-0.30103, 1.}, {-0.30103, 1.}, {-0.30103, 1.}, {-0.30103, 1.}, {-0.30103, 1.}, {-0.30103, 1.}, {-0.30103, 1.}, {-0.30103, 1.}, {-1., 0.}, {-1., 0.}, {-1., 0.}, {-1., 0.}, {-1., 0.}, {-1., 0.}, {-1., 0.}, {-1., 0.}, {-1., 0.}, {-1., 0.}, {-1., 0.}, {-1., 0.}, {-1.30103, 0.}, {-1.30103, 0.}, {-1.30103, 0.}, {-1.30103, 0.}, {-1.30103, 0.}, {-1.30103, 0.}, {-1.30103, 0.}, {-1.30103, 0.}, {-1.30103, 0.}, {-1.30103, 0.}, {-1.30103, 0.}, {-1.30103, 1.} }

POSTED BY: Terry Acree
Posted 7 years ago

I'm having a hard time understanding the seemingly inconsistent and non-standard GLM language you are using. Below I'm just attempting to state what I think you have in terms of more standard statistical language (or if you want, jargon).

If you use the command

GeneralizedLinearModelFit[p, x, x, ExponentialFamily -> "Binomial"]

you have a dataset named p with a single predictor variable x such that response variable y has a Bernoulli distribution (equivalent to a binomial distribution with a sample size of 1) with parameter $P$ (not to be confused with the name of your dataset) equal to

$$P=1-1/(1+e^{c0 +c_1 x})$$

or equivalently

$$\log(P/(1-P))=c_0+c_1 x$$

where $x$ is the relative concentration of odorant $A$ with $x=A/(A+B)$.

If you knew $c_0$ and $c_1$, then you could determine the value of $x$ that satisfies

$$P=1-1/(1+\exp{(c0+c_1 x}))$$

But you only have a sample of binomial results from a variety of relative concentrations. To obtain confidence intervals for the above value of $x$ when $P=0.5$ you would use the commands I gave earlier. (And, sorry, using $c_0$ sometimes displays as $c0$. Don't know why.)

You can probably find more concrete examples of what you want from searching for "LD50 confidence intervals".

POSTED BY: Jim Baldwin
POSTED BY: Terry Acree
Attachment

Attachments:
POSTED BY: Terry Acree
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard