How to fix an error in nonlinear regression

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to fix an error in nonlinear regression

Vahid
Hello my R friends,
I am using the below commands in R:

attach(Puromycin)
Puromycin
plot(Puromycin$conc,Puromycin$rate)
mm=function(conc,vmax,k) vmax*conc/(k+conc)
mm
mm1=nls(rate~mm(conc,vmax,k),data=Puromycin,start=c(vmax=50,k=0.05),subset=state==”treated”)
mm1

Unfortunately,  I receive the below error:

Error: unexpected input in
"mm1=nls(rate~mm(conc,vmax,k),data=Puromycin,start=c(vmax=50,k=0.05),subset=state==”"

How can I fix this error?

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: How to fix an error in nonlinear regression

John Kane-3
You have subset=state==”treated”). You need to change "treated” to
"treated". Tho " " are formatted in your example.

On Wed, 27 May 2020 at 15:48, Vahid Borji <[hidden email]> wrote:

> Hello my R friends,
> I am using the below commands in R:
>
> attach(Puromycin)
> Puromycin
> plot(Puromycin$conc,Puromycin$rate)
> mm=function(conc,vmax,k) vmax*conc/(k+conc)
> mm
>
> mm1=nls(rate~mm(conc,vmax,k),data=Puromycin,start=c(vmax=50,k=0.05),subset=state==”treated”)
> mm1
>
> Unfortunately,  I receive the below error:
>
> Error: unexpected input in
>
> "mm1=nls(rate~mm(conc,vmax,k),data=Puromycin,start=c(vmax=50,k=0.05),subset=state==”"
>
> How can I fix this error?
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
>


--
John Kane
Kingston ON Canada

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: How to fix an error in nonlinear regression

Vahid
Thanks a lot.

On Thu, May 28, 2020 at 1:15 AM John Kane <[hidden email]> wrote:

> You have subset=state==”treated”). You need to change "treated” to
> "treated". Tho " " are formatted in your example.
>
> On Wed, 27 May 2020 at 15:48, Vahid Borji <[hidden email]> wrote:
>
>> Hello my R friends,
>> I am using the below commands in R:
>>
>> attach(Puromycin)
>> Puromycin
>> plot(Puromycin$conc,Puromycin$rate)
>> mm=function(conc,vmax,k) vmax*conc/(k+conc)
>> mm
>>
>> mm1=nls(rate~mm(conc,vmax,k),data=Puromycin,start=c(vmax=50,k=0.05),subset=state==”treated”)
>> mm1
>>
>> Unfortunately,  I receive the below error:
>>
>> Error: unexpected input in
>>
>> "mm1=nls(rate~mm(conc,vmax,k),data=Puromycin,start=c(vmax=50,k=0.05),subset=state==”"
>>
>> How can I fix this error?
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] 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.
>>
>
>
> --
> John Kane
> Kingston ON Canada
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: How to fix an error in nonlinear regression

Rui Barradas
In reply to this post by Vahid
Hello,

This is cross posted [1] which is not well seen. Post and wait for an
answer, which you got and are now asking the same, why? Maybe with time
other answer will be posted to the first, original, question.


[1]
https://stackoverflow.com/questions/62051714/how-can-i-fix-an-error-in-nonlinear-regression-nls-function


Rui Barradas

Às 20:43 de 27/05/20, Vahid Borji escreveu:

> Hello my R friends,
> I am using the below commands in R:
>
> attach(Puromycin)
> Puromycin
> plot(Puromycin$conc,Puromycin$rate)
> mm=function(conc,vmax,k) vmax*conc/(k+conc)
> mm
> mm1=nls(rate~mm(conc,vmax,k),data=Puromycin,start=c(vmax=50,k=0.05),subset=state==”treated”)
> mm1
>
> Unfortunately,  I receive the below error:
>
> Error: unexpected input in
> "mm1=nls(rate~mm(conc,vmax,k),data=Puromycin,start=c(vmax=50,k=0.05),subset=state==”"
>
> How can I fix this error?
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.