[R] invalid type (list) for variable 'y' in library minpack.lm

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Thu Jun 25 16:52:11 CEST 2020


"These other questions seem good and
interesting, I hope someone else can answer
them."

Perhaps, but not appropriate for this list, imo. Statistics issue mostly
belong elsewhere, e.g. on stats.stackexchange.com.

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Jun 25, 2020 at 4:25 AM Rasmus Liland <jral using posteo.no> wrote:

> Dear Luigi,
>
> On 2020-06-25 12:18 +0200, Luigi Marongiu wrote:
> > Hello,
> > I am trying to find the best fit to a
> > function for epidemic analysis.
> > I am trying with the package minpack.lm but
> > I don't really know how to use it.
>
> Me neither ...
>
> > So I have some questions:
> > - how to solve the list problem? (what is
> >   the input for nlsLM? I have a vector with
> >   the actual values, shall I convert in a
> >   dataframe?)
>
> I got past the error by give
> minpack.lm::nlsLM X and Y in a data.frame
>
>         minpack.lm::nlsLM(
>           formula = y~(a*x^2)/(b^2 + x^2),
>           start=c(a=A, b=B),
>           data=data.frame(x=X, y=Y))
>
> as per ?minpack.lm::nlsLM:
>
>         data: an optional data frame in which to evaluate the variables
>               in‘formula’ and ‘weights’.  Can also be a list or an
>               environment, but not a matrix.
>
> > - how to avoid infinitives?
> > - is there another function other than
> >   nlsLM that I should use?
> > - is there another function that could fit
> >   a sigmoid profile other than Holling type
> >   III?
>
> These other questions seem good and
> interesting, I hope someone else can answer
> them.
>
> Best,
> Rasmus
> ______________________________________________
> 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.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list