[R] nlme plot

R V villegas.ro at gmail.com
Tue Jul 12 02:01:44 CEST 2005


Hello,

I am running this script from Pinheiro & Bates book in R Version 2.1.1 (WinXP).
But, I can't plot Figure 2.3.
What's wrong?


TIA.
Rod.

---------------------------------------------------------
>library(nlme)
> names( Orthodont )
[1] "distance" "age"      "Subject"  "Sex"     
> levels( Orthodont$Sex )
[1] "Male"   "Female"
> OrthoFem <- Orthodont[ Orthodont$Sex == "Female", ]
> 
> fm1OrthF <- lme( distance ~ age, data = OrthoFem, random = ~ 1 | Subject )
> fm2OrthF <- update( fm1OrthF, random = ~ age | Subject )
> orthLRTsim <- simulate.lme( fm1OrthF, fm2OrthF, nsim = 1000 )
> plot( orthLRTsim, df = c(1, 2) )    # produces Figure 2.3
Error in if ((dfType <- as.double(names(x)[1])) == 1) { : 
	argument is of length zero
Execution halted




More information about the R-help mailing list