[R] how to get inflection point in binomial glm
David Winsemius
dwinsemius at comcast.net
Thu Dec 1 17:34:59 CET 2011
On Dec 1, 2011, at 8:24 AM, René Mayer wrote:
> Dear All,
>
> I have a binomial response with one continuous predictor (d) and one
> factor (g) (8 levels dummy-coded).
>
> glm(resp~d*g, data, family=binomial)
>
> Y=b0+b1*X1+b2*X2 ... b7*X7
Dear Dr Mayer;
I think it might be a bit more complex than that. I think you should
get 15 betas rather than 8. Have you done it?
>
> how can I get the inflection point per group, e.g., P(d)=.5
Wouldn't that just be at d=1/beta in each group? (Thinking, perhaps
naively, in the case of X=X1 that
(Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta *d*(X==X1) ) # all other
terms = 0
And taking the log of both sides, and then use "middle school" math to
solve.
Oh, wait. Muffed my first try on that for sure. Need to add back both
the constant intercept and the baseline "d" coefficient for the non-b0
levels.
(Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta_0 + beta_d_0*d +
beta_n + beta_d_n *d*(X==Xn) )
And just
(Pr[y==1])/(1-Pr[y==1])) = 1 = exp( beta_0 + beta_d_0*d ) # for the
reference level.
This felt like an exam question in my categorical analysis course 25
years ago. (Might have gotten partial credit for my first stab,
depending on how forgiving the TA was that night.)
>
> I would be grateful for any help.
>
> Thanks in advance,
> René
>
--
David Winsemius, MD
West Hartford, CT
More information about the R-help
mailing list