[R] gamm error message

Highland Statistics Ltd. highstat at highstat.com
Wed Jun 7 00:26:54 CEST 2006


Hello,

Why would I get an error message  with the following code for gamm? I 
want to fit the a gam with different variances per stratum.


library(mgcv)
library(nlme)

Y<-rnorm(100)
X<-rnorm(100,sd=2)
Z<-rep(c(T,F),each=50)

test<-gamm(Y~s(X),weights=varIdent(form=~1|Z))

summary(test$lme)   #ok

summary(test$gam)

Gives an error message:
Error in inherits(x, "data.frame") : dim<- : dims [product 100] do 
not match the length of object [0]


All the other output seems to be ok:


 > summary(test$lme)
Linear mixed-effects model fit by maximum likelihood
  Data: strip.offset(mf)
        AIC      BIC    logLik
   299.9468 312.9727 -144.9734

Random effects:
  Formula: ~Xr.1 - 1 | g.1
  Structure: pdIdnot
                Xr.11        Xr.12        Xr.13        Xr.14        Xr.15
StdDev: 0.0001073404 0.0001073404 0.0001073404 0.0001073404 0.0001073404
                Xr.16        Xr.17        Xr.18 Residual
StdDev: 0.0001073404 0.0001073404 0.0001073404 1.045916

Variance function:
  Structure: Different standard deviations per stratum
  Formula: ~1 | Z
  Parameter estimates:
      TRUE     FALSE
1.0000000 0.9721987
Fixed effects: y ~ X.0 - 1
                      Value Std.Error DF    t-value p-value
X.0(Intercept)  0.04426102 0.1041540 98  0.4249573  0.6718
X.0s(X)Fx1     -0.01053900 0.1039558 98 -0.1013796  0.9195
  Correlation:
            X.0(I)
X.0s(X)Fx1 0.002

Standardized Within-Group Residuals:
         Min          Q1         Med          Q3         Max
-1.96955692 -0.81101014  0.07004034  0.72528662  2.44244302

Number of Observations: 100
Number of Groups: 1





Kind regards,

Alain



More information about the R-help mailing list