[R] nlsList - Error in !unlist(lapply(coefs, is.null))
Marc Belisle
marc.m.belisle at usherbrooke.ca
Tue Feb 19 16:17:20 CET 2008
Howdee,
I am able to fit a 4-parameter logistic growth curve to a dataset which
comprise many individuals (using R v. 2.3.1). Yet, if I want to obtain the
parameters for each individual (i.e., for each 'id') using nlsList, then I
obtain an Error message which I have trouble interpreting. Any advice as to
how I can solve this problem?
Thanks for your time,
Marc
> reg <-nls(mass ~ SSfpl(age, A, B, xmid, scal),
+ na.action=na.omit,
+ data=data)
> summary(reg)
Formula: mass ~ SSfpl(age, A, B, xmid, scal)
Parameters:
Estimate Std. Error t value Pr(>|t|)
A 1.42895 0.24472 5.839 5.43e-09 ***
B 21.71508 0.06551 331.495 < 2e-16 ***
xmid 5.93563 0.05773 102.821 < 2e-16 ***
scal 1.92278 0.04334 44.369 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.715 on 9039 degrees of freedom
> coef(reg)
A B xmid scal
1.428954 21.715081 5.935634 1.922779
> reg <-nlsList(mass ~ SSfpl(age, A, B, xmid, scal)|id,
+ na.action=na.omit,
+ data=data)
> reg
Call:
Model: mass ~ SSfpl(age, A, B, xmid, scal) | id
Data: data
Coefficients:
Error in !unlist(lapply(coefs, is.null)) :
incorrect type of argument
===================
Marc Bélisle
Professeur adjoint
Chaire de recherche du Canada en écologie spatiale et en écologie du paysage
Département de biologie
Université de Sherbrooke
2500 Boul. de l'Université
Sherbrooke, Québec
J1K 2R1 Canada
Tél: +1-819-821-8000 poste 61313
Fax: +1-819-821-8049
Courriél: Marc.M.Belisle at USherbrooke.ca
More information about the R-help
mailing list