Friday, January 14, 2011

Stringr package in R

A new package from Hadley Wickham - a string processing package that "provides string functions that are simpler and more consistent [than existing functions in R], and also fixes some functionality that R is missing compared to other programming languages".

http://journal.r-project.org/archive/2010-2/RJournal_2010-2_Wickham.pdf

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:"



Subscribe via email

Enter your email address:

Delivered by FeedBurner

Followers

google analytics