# [R] Error Message from Variogram.lme Example

Rick Bilonick rab45+ at pitt.edu
Mon Mar 13 23:18:18 CET 2006

```When I try to run the example from Variogram with an lme object, I get
an error (although summary works):

R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.2.1  (2005-12-20 r36812)
ISBN 3-900051-07-0
...

>  fm1 <- lme(weight ~ Time * Diet, BodyWeight, ~ Time | Rat)
Error: couldn't find function "lme"
>      Variogram(fm1, form = ~ Time | Rat, nint = 10, robust = TRUE)
Error: couldn't find function "Variogram"
> library(nlme)
>  fm1 <- lme(weight ~ Time * Diet, BodyWeight, ~ Time | Rat)
>      Variogram(fm1, form = ~ Time | Rat, nint = 10, robust = TRUE)
Error in "\$<-.data.frame"(`*tmp*`, "n.pairs", value = c(160, 0, 160,
16,  :
replacement has 10 rows, data has 9

> summary(fm1)
Linear mixed-effects model fit by REML
Data: BodyWeight
AIC      BIC    logLik
1171.720 1203.078 -575.8599

Random effects:
Formula: ~Time | Rat
Structure: General positive-definite, Log-Cholesky parametrization
StdDev     Corr
(Intercept) 36.9390723 (Intr)
Time         0.2484113 -0.149
Residual     4.4436052

Fixed effects: weight ~ Time * Diet
Value Std.Error  DF   t-value p-value
(Intercept) 251.65165 13.094025 157 19.218816  0.0000
Time          0.35964  0.091140 157  3.946019  0.0001
Diet2       200.66549 22.679516  13  8.847873  0.0000
Diet3       252.07168 22.679516  13 11.114509  0.0000
Time:Diet2    0.60584  0.157859 157  3.837858  0.0002
Time:Diet3    0.29834  0.157859 157  1.889903  0.0606
Correlation:
(Intr) Time   Diet2  Diet3  Tm:Dt2
Time       -0.160
Diet2      -0.577  0.092
Diet3      -0.577  0.092  0.333
Time:Diet2  0.092 -0.577 -0.160 -0.053
Time:Diet3  0.092 -0.577 -0.053 -0.160  0.333

Standardized Within-Group Residuals:
Min          Q1         Med          Q3         Max
-3.25558796 -0.42196874  0.08229384  0.59933559  2.78994477

Number of Observations: 176
Number of Groups: 16

Information on package 'nlme'

Description:

Package:       nlme
Version:       3.1-68.1
Date:          2006-01-05

Rick B.

```