Dear r-helpers, After successfully running require(nlme) vfr.lmL <- lmList( estimate ~ (slant + respType + visField + hand)^2 | subject, vfr ) pairs(vfr.lmL, id = 0.01, adj = -0.5) # Pinheiro & Bates (p. 141) produces the following error: Error in sprintf(gettext(fmt, domain = domain), ...) : object "form" not found Any guesses as to what I may have done wrong? vfr is not a grouped object because: vfrg <- groupedData(estimate ~ slant | subject, data = vfr) vfrg.lmL <- lmList( estimate ~ (slant + respType + visField + hand)^2 | subject, vfrg) Error in function (classes, fdef, mtable) : unable to find an inherited method for function "lmList", for signature "formula", "nfnGroupedData" The data are at http://www.people.virginia.edu/~mk9y/LongFormat.csv To get the working data.frame: vf <- read.table("http://www.people.virginia.edu/~mk9y/ LongFormat.csv", header = TRUE, sep=',') names(vf) <- c( 'slant', 'estimate', 'respType', 'visField', 'hand', 'order', 'sex', 'subject', 'handPref' ) require(reshape) vf <- sort_df(vf, vars = 'slant') vf$subject <- factor(vf$subject) summary(vf) vfr <- subset(vf, handPref == 'R', select = -handPref) vfr <- subset(vfr, slant %in% c(10, 20, 30)) _____________________________ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400 Charlottesville, VA 22904-4400 Parcels: Room 102 Gilmer Hall McCormick Road Charlottesville, VA 22903 Office: B011 +1-434-982-4729 Lab: B019 +1-434-982-4751 Fax: +1-434-982-4766 WWW: http://www.people.virginia.edu/~mk9y/
The age of this post makes me hope there is an easy response from someone. When I do the following with Orthodont built-in dataset: library(nlme) OrthoFem<-Orthodont[Orthodont$Sex=="Female",] fm1OrthF.lis<-lmList( distance ~ age,data = OrthoFem) I get the same error: Error in function (classes, fdef, mtable) : unable to find an inherited method for function "lmList", for signature "formula", "nfnGroupedData" Since this is straight out of Pinheio & Bates book and the same thing happens when I use the example posted with ?lmList, I have no idea what to do. Thank you. Michael Kubovy wrote:> > Dear r-helpers, > > After successfully running > require(nlme) > vfr.lmL <- lmList( > estimate ~ (slant + respType + visField + hand)^2 | subject, vfr > ) > > pairs(vfr.lmL, id = 0.01, adj = -0.5) # Pinheiro & Bates (p. 141) > produces the following error: > Error in sprintf(gettext(fmt, domain = domain), ...) : > object "form" not found > > Any guesses as to what I may have done wrong? > > vfr is not a grouped object because: > > vfrg <- groupedData(estimate ~ slant | subject, data = vfr) > vfrg.lmL <- lmList( > estimate ~ (slant + respType + visField + hand)^2 | subject, > vfrg) > Error in function (classes, fdef, mtable) : > unable to find an inherited method for function "lmList", for > signature "formula", "nfnGroupedData" > > The data are at > http://www.people.virginia.edu/~mk9y/LongFormat.csv > > To get the working data.frame: > vf <- read.table("http://www.people.virginia.edu/~mk9y/ > LongFormat.csv", header = TRUE, sep=',') > names(vf) <- c( > 'slant', 'estimate', 'respType', 'visField', 'hand', > 'order', 'sex', 'subject', 'handPref' > ) > require(reshape) > vf <- sort_df(vf, vars = 'slant') > vf$subject <- factor(vf$subject) > summary(vf) > vfr <- subset(vf, handPref == 'R', select = -handPref) > vfr <- subset(vfr, slant %in% c(10, 20, 30)) > > _____________________________ > Professor Michael Kubovy > University of Virginia > Department of Psychology > USPS: P.O.Box 400400 Charlottesville, VA 22904-4400 > Parcels: Room 102 Gilmer Hall > McCormick Road Charlottesville, VA 22903 > Office: B011 +1-434-982-4729 > Lab: B019 +1-434-982-4751 > Fax: +1-434-982-4766 > WWW: http://www.people.virginia.edu/~mk9y/ > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > 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. >-- View this message in context: http://r.789695.n4.nabble.com/R-Problem-with-pairs-in-nlme-tp813548p3437439.html Sent from the R help mailing list archive at Nabble.com.
Apr 08, 2011; 11:05pm dgmaccon wrote:>> I get the same error: >> Error in function (classes, fdef, mtable) : >> unable to find an inherited method for function "lmList", for signature >> "formula", "nfnGroupedData"I get no such error. You need to provide more information (platform &c.) ## library(nlme) OrthoFem<-Orthodont[Orthodont$Sex=="Female",] fm1OrthF.lis<-lmList( distance ~ age,data = OrthoFem)> fm1OrthF.lisCall: Model: distance ~ age | Subject Data: OrthoFem Coefficients: (Intercept) age F10 13.55 0.450 F09 18.10 0.275 F06 17.00 0.375 F01 17.25 0.375 F05 19.60 0.275 F07 16.95 0.550 F02 14.20 0.800 F08 21.45 0.175 F03 14.40 0.850 F04 19.65 0.475 F11 18.95 0.675 Degrees of freedom: 44 total; 22 residual Residual standard error: 0.6682746 Regards, Mark.> sessionInfo()R version 2.13.0 Under development (unstable) (2011-03-15 r54806) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_South Africa.1252 LC_CTYPE=English_South Africa.1252 [3] LC_MONETARY=English_South Africa.1252 LC_NUMERIC=C [5] LC_TIME=English_South Africa.1252 attached base packages: [1] grid splines stats graphics grDevices utils datasets methods base other attached packages: [1] nlme_3.1-100 lattice_0.19-17 rms_3.3-0 Hmisc_3.8-3 survival_2.36-5 loaded via a namespace (and not attached): [1] cluster_1.13.3 effects_2.0-12 tools_2.13.0 -- View this message in context: http://r.789695.n4.nabble.com/R-Problem-with-pairs-in-nlme-tp813548p3438266.html Sent from the R help mailing list archive at Nabble.com.