@Krylov Thank you! now the preview works, but the actual nls still gives an error:
``` > form = as.formula(Response ~ ( (exp((a+b*Dose))) / (1+exp(-(a+b*Dose)) ))) > preview(form, data = df, start=list(a=A, b=B)) RSS: 33200000 > nls(Response ~ ( (exp((a+b*Dose))) / (1+exp(-(a+b*Dose)) )), + data=df, start=list(a=A, b=B)) Error in numericDeriv(form[[3L]], names(ind), env, central = nDcentral) : Missing value or an infinity produced when evaluating the model ``` @Berger Thank you and sorry for the typo: `x_25_2024` was the original data; it is `df` in the example. nls(form, data=df) worked for me too. On Sat, Sep 20, 2025 at 9:39 AM Ivan Krylov <ikry...@disroot.org> wrote: > > В Sat, 20 Sep 2025 08:02:16 +0200 > Luigi Marongiu <marongiu.lu...@gmail.com> пишет: > > > nls(Response ~ ( (exp(a+b*Dose)) / (1+exp-(a+b*Dose)) ), > > data=df, start=list(a=A, b=B)) > > Thank you for providing a reproducible example! > > 1+exp-(a+b*Dose) is parsed as 1 + `exp` - (a+b*Dose), treating `exp` as > a summand, and summing a function doesn't make sense in base R. > > In order to pass -(a+b*Dose) as the argument to exp(), this needs to be > written as 1+exp(-(a+b*Dose)) instead. > > -- > Best regards, > Ivan -- Best regards, Luigi ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide https://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.