[R] nlsList (nlme) error
Rick DeShon
deshon at msu.edu
Fri Jan 25 18:59:48 CET 2008
Hi All.
I'm trying to run nlsList an getting an error that makes no sense to
me. I have accuracy and reaction time data over many trials for each
person (id)
When I use nlsList code that is virtually identical to the example in
the doc file I get the following error. I've tried everything I could
think of and can't get around it. Any ideas what I'm doing wrong?
**************
fm.nls<-nlsList(RT ~ SSasymp(trial, Asym, R0, lrc) ,
data = df.group,
na.action="na.exclude",
start = c(Asym = 550, R0 = 770, rc =-2.5))
"Error in nlsList.formula(RT ~ SSasymp(trial, Asym, R0, lrc),
data = df.group, :
Data must be a groupedData object if formula does not include groups"
***************
Here's the first 10 records of my data:
> df.group[1:10,]
Grouped Data: RT ~ trial | id
id trial ACC RT block
1.1 1 1 1 1111 1
2.1 2 1 0 NA 1
3.1 3 1 1 1309 1
4.1 4 1 1 544 1
5.1 5 1 1 654 1
6.1 6 1 0 NA 1
7.1 7 1 1 441 1
8.1 8 1 1 882 1
9.1 9 1 1 1097 1
10.1 10 1 1 898 1
The data are clearly grouped. Just to be sure....
str(df.group)
Classes 'nfnGroupedData', 'nfGroupedData', 'groupedData' and
'data.frame': 15480 obs. of 5 variables:
$ id : Ord.factor w/ 43 levels "31"<"8"<"30"<..: 41 11 33 22 4 27 5
2 37 19 ...
$ trial: int 1 1 1 1 1 1 1 1 1 1 ...
$ ACC : int 1 0 1 1 1 0 1 1 1 1 ...
$ RT : int 1111 NA 1309 544 654 NA 441 882 1097 898 ...
$ block: int 1 1 1 1 1 1 1 1 1 1 ...
- attr(*, "formula")=Class 'formula' length 3 RT ~ trial | id
.. ..- attr(*, ".Environment")=<R_GlobalEnv>
- attr(*, "FUN")=function (x)
- attr(*, "order.groups")= logi TRUE
Thanks!
Rick DeShon
> version
_
platform i386-apple-darwin8.10.1
arch i386
os darwin8.10.1
system i386, darwin8.10.1
status
major 2
minor 6.1
year 2007
month 11
day 26
svn rev 43537
language R
version.string R version 2.6.1 (2007-11-26)
More information about the R-help
mailing list