Thursday, January 13, 2011

R: how to extract parameter from AR1 fit in gls/nlme

fit = gls(y~pop,data=data,corr = corAR1(.5, form = ~ 1 | trio))



> coef(fit$model$corStruct,unconstrained = FALSE)
  Phi1
0.0384

** without the unconstrained = FALSE option, it gives some other (?) number




Alternatively, intervals(fit)$corStruct gives a vector with confidence intervals 

> intervals(fit)$corStruct
      lower   est. upper
Phi1 -0.421 0.0384 0.482
attr(,"label")
[1] "Correlation structure:"



No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner

Followers

google analytics