Hello, I have this data: Time AMP 0 0.2000000 10 0.1958350 20 0.2914560 40 0.6763628 60 0.8494534 90 0.9874526 120 1.0477692 where AMP is the concentration of this metabolite with time. If you plot the data, you can see that it could be fitted using a logistic regression. For this purpose, I used this code: AMP.nls <- nls(AMP~SSlogis(Time,Asym, xmid, scal), data concentrations,model=T) When plotting the fitted function, it seems that it fits quite well at the end of the time. However, at the beginning it seems that the fit is not so good. How can I achieve a better fit? Forgive me if it is a stupid question, but I am just starting with non linear regression. Thank you, Dani -- [?]
with my limited understanding, I am not surprised to see this data fitting nicely at the end just by eyeballing at it. the reaction at the early time point is not completed as the time passes which is close to 20 units the reaction generates more metabolite to be measured reliably your t=0 and t=10 are basically the same, if i limit the digits to 2 then the values will be 0.20. you can do the log transform and then try to fit it. Dani Valverde-4 wrote:> > Hello, > I have this data: > Time AMP > 0 0.2000000 > 10 0.1958350 > 20 0.2914560 > 40 0.6763628 > 60 0.8494534 > 90 0.9874526 > 120 1.0477692 > > where AMP is the concentration of this metabolite with time. If you plot > the data, you can see that it could be fitted using a logistic > regression. For this purpose, I used this code: > > AMP.nls <- nls(AMP~SSlogis(Time,Asym, xmid, scal), data > concentrations,model=T) > > When plotting the fitted function, it seems that it fits quite well at > the end of the time. However, at the beginning it seems that the fit is > not so good. How can I achieve a better fit? Forgive me if it is a > stupid question, but I am just starting with non linear regression. > Thank you, > > Dani > -- > [?] > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >-- View this message in context: nabble.com/Fitting-a-logistic-regression-tp25041444p25043712.html Sent from the R help mailing list archive at Nabble.com.
I would suggest a model with a baseline level, something like nls(AMP~E0+(Emax-E0)*Time**gamma/(EC50**gamma+Time**gamma),data=your data, start=list(EC50=50,gamma=2,E0=0.2,Emax=1.2))->mod.test AIC(mod.test) does improve. Hope this helps. Jun On Wed, Aug 19, 2009 at 5:04 AM, Dani Valverde <daniel.valverde@uab.cat>wrote:> Hello, > I have this data: > Time AMP > 0 0.2000000 > 10 0.1958350 > 20 0.2914560 > 40 0.6763628 > 60 0.8494534 > 90 0.9874526 > 120 1.0477692 > > where AMP is the concentration of this metabolite with time. If you plot > the data, you can see that it could be fitted using a logistic > regression. For this purpose, I used this code: > > AMP.nls <- nls(AMP~SSlogis(Time,Asym, xmid, scal), data > concentrations,model=T) > > When plotting the fitted function, it seems that it fits quite well at > the end of the time. However, at the beginning it seems that the fit is > not so good. How can I achieve a better fit? Forgive me if it is a > stupid question, but I am just starting with non linear regression. > Thank you, > > Dani > -- > [?] > > ______________________________________________ > R-help@r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Jun Shen PhD PK/PD Scientist BioPharma Services Millipore Corporation 15 Research Park Dr. St Charles, MO 63304 Direct: 636-720-1589 [[alternative HTML version deleted]]
Thank you very much, Jun. This is what I was looking for. Best! Dani On Wed, 2009-08-19 at 09:52 -0500, Jun Shen wrote:> I would suggest a model with a baseline level, something like > > nls(AMP~E0+(Emax-E0)*Time**gamma/(EC50**gamma+Time**gamma),data=your > data, > start=list(EC50=50,gamma=2,E0=0.2,Emax=1.2))->mod.test > > AIC(mod.test) does improve. Hope this helps. > > Jun > > On Wed, Aug 19, 2009 at 5:04 AM, Dani Valverde > <daniel.valverde at uab.cat> wrote: > Hello, > I have this data: > Time AMP > 0 0.2000000 > 10 0.1958350 > 20 0.2914560 > 40 0.6763628 > 60 0.8494534 > 90 0.9874526 > 120 1.0477692 > > where AMP is the concentration of this metabolite with time. > If you plot > the data, you can see that it could be fitted using a logistic > regression. For this purpose, I used this code: > > AMP.nls <- nls(AMP~SSlogis(Time,Asym, xmid, scal), data > concentrations,model=T) > > When plotting the fitted function, it seems that it fits quite > well at > the end of the time. However, at the beginning it seems that > the fit is > not so good. How can I achieve a better fit? Forgive me if it > is a > stupid question, but I am just starting with non linear > regression. > Thank you, > > Dani > -- > [?] > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible > code. > > > > -- > Jun Shen PhD > PK/PD Scientist > BioPharma Services > Millipore Corporation > 15 Research Park Dr. > St Charles, MO 63304 > Direct: 636-720-1589 >-- Daniel Valverde Saub? Grup de Biologia Molecular de Llevats Facultat de Veterin?ria de la Universitat Aut?noma de Barcelona Edifici V, Campus UAB 08193 Cerdanyola del Vall?s- SPAIN Tlf. +34 93 581 1910 Fax: +34 93 581 1573