Skip to content

how to get inflection point in binomial glm

5 messages · René Mayer, David Winsemius, Rubén Roa

#
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

how can I get the inflection point per group, e.g., P(d)=.5

I would be grateful for any help.

Thanks in advance,
Ren?
#
Assuming a logistic model, for each group solve for d at Y=0, or solve for d at p=0.5, where d is your continuous predictor, Y is the logit score, and p is the probability of success in the binomial model. After that you can get the standard error of the inflection point by Taylor series (aka delta method).

Another idea is to re-parameterize the logistic model to include explicitly the inflection point, thus you'll get its estimate and standard error directly as a result of the fit.
For example, disregarding the g factor predictor (or for each group), a logistic model such as
P(d) = 1/(1+exp(log(1/19)(d-d50)/(d95-d50))
includes the inflection point directly (d50) and is a re-parameterized version of the usual logistic model
P(d) =1/(1+exp(b0+b1*d))
where parameters b0 and b1 have been replaced by d95 and d50, the predictor at 50% probability (inflection point), and the predictor at 95% probability, respectively.

HTH

Rub?n

-----Mensaje original-----
De: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] En nombre de Ren? Mayer
Enviado el: jueves, 01 de diciembre de 2011 14:25
Para: r-help at r-project.org
Asunto: [R] how to get inflection point in binomial glm

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

how can I get the inflection point per group, e.g., P(d)=.5

I would be grateful for any help.

Thanks in advance,
Ren?

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
#
On Dec 1, 2011, at 8:24 AM, Ren? Mayer wrote:

            
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?
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.)
#
Thanks David and Rub?n!

@David: indeed 15 betas I forgot the interaction terms, thanks for correcting!

@Rub?n:  the re-parameterize would be done within nls()? how to do  
this practically with including the factor predictor?

and yes, we can solve within each group for Y=0 getting

0=b0+b1*X |-b0
-b0=b1*X |/b1
-b0/b1=X

but I was hoping there might a more general solution for the case of  
multiple logistic regression.


HTH

Ren?

Zitat von "David Winsemius" <dwinsemius at comcast.net>:
#
Ren?,

Yes, to fit a re-parameterized logistic model I think you'd have to code the whole enchilada yourself, not relying on glm (but not nls() as nls() deals with least squares minimization whereas here we want to minimize a minus log binomial likelihood).

I did that and have the re-parameterized logistic model in a package I wrote for a colleague (this package has the logistic fit fully functional and documented).
My code though only considers one continuous predictor.

If you want I may email you this package and you figure out how to deal with the categorical predictor.
One thing I believe at this point is that you'd have to do the inference on the continuous predictor _conditional_ on certain level(s) of the categorical predictor.

Rub?n

-----Mensaje original-----
De: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] En nombre de Ren? Mayer
Enviado el: jueves, 01 de diciembre de 2011 20:34
Para: David Winsemius
CC: r-help Help
Asunto: Re: [R] how to get inflection point in binomial glm

Thanks David and Rub?n!

@David: indeed 15 betas I forgot the interaction terms, thanks for correcting!

@Rub?n:  the re-parameterize would be done within nls()? how to do this practically with including the factor predictor?

and yes, we can solve within each group for Y=0 getting

0=b0+b1*X |-b0
-b0=b1*X |/b1
-b0/b1=X

but I was hoping there might a more general solution for the case of multiple logistic regression.


HTH

Ren?

Zitat von "David Winsemius" <dwinsemius at comcast.net>:
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.