[R] Nonlinear logistic regression fitting

Sebastien Bihorel Seb@@t|en@B|hore| @end|ng |rom cogn|gencorp@com
Tue Jul 28 18:59:57 CEST 2020


Hi Rui,

Thanks for your input.

In my analysis, the MM model is not intended to fit continuous data but must be used within a logistic regression model of binary data. So, while useful in itself, the suggested example does not exactly apply.

I appreciate your time

________________________________
From: Rui Barradas <ruipbarradas using sapo.pt>
Sent: Tuesday, July 28, 2020 12:42
To: Sebastien Bihorel <Sebastien.Bihorel using cognigencorp.com>; r-help using r-project.org <r-help using r-project.org>
Subject: Re: [R] Nonlinear logistic regression fitting

Hello,

glm might not be the right tool for the MM model but nls is meant to fit
non-linear models.
And, after an on-line search, there is also package drc, function drm.

I will use the data and examples in the links below. (The second gave me
right, it uses nls.)


#install.packages("drc")
library(drc)

#--- data

# substrate
S <- c(0,1,2,5,8,12,30,50)

# reaction rate
v <- c(0,11.1,25.4,44.8,54.5,58.2,72.0,60.1)
kinData <- data.frame(S, v)


#--- package drc fit

# use the two parameter MM model (MM.2)
drm_fit <- drm(v ~ S, data = kinData, fct = MM.2())

#--- nls fit
MMcurve <- formula(v ~ Vmax*S/(Km + S))
nls_fit <- nls(MMcurve, kinData, start = list(Vmax = 50, Km = 2))

coef(drm_fit)
coef(nls_fit)

#--- plot

SconcRange <- seq(0, 50, 0.1)
nls_Line <- predict(nls_fit, list(S = SconcRange))

plot(drm_fit, log = '', pch = 17, col = "red", main = "Fitted MM curve")
lines(SconcRange, nls_Line, col = "blue", lty = "dotted")


[1]
https://davetang.org/muse/2013/05/17/fitting-a-michaelis-mentens-curve-using/
[2]
http://rforbiochemists.blogspot.com/2015/05/plotting-and-fitting-enzymology-data.html


Hope this helps,

Rui Barradas

�s 15:13 de 28/07/2020, Sebastien Bihorel via R-help escreveu:
> Hi
>
> I need to fit a logistic regression model using a saturable Michaelis-Menten function of my predictor x. The likelihood could be expressed as:
>
> L = intercept + emax * x / (EC50+x)
>
> Which I guess could be expressed as the following R model
>
> ~ emax*x/(ec50+x)
>
> As far as I know (please, correct me if I am wrong), fitting such a model is to not doable with glm, since the function is not linear.
>
> A Stackoverflow post recommends the bnlr function from the gnlm (https://stackoverflow.com/questions/45362548/nonlinear-logistic-regression-package-in-r)... I would be grateful for any opinion on this package or for any alternative recommendation of package/function.
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.


--
Este e-mail foi verificado em termos de v�rus pelo software antiv�rus Avast.
https://www.avast.com/antivirus


	[[alternative HTML version deleted]]



More information about the R-help mailing list