[R-sig-ME] How to find ACF, PACF, Sample Variance-Covariance Matrix of Random-Effects?

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Tue Oct 11 02:27:56 CEST 2022


   Can you give an example please?

   The covariance matrix is typically (for nlme and other packages that 
follow the same conventions) extracted with VarCorr().  As described in 
my other e-mail to the list, this is not *quite* the same as the full 
covariance matrix of the random-effects vector, but rather the 
covariance matrix for a single grouping variable/block.  VarCorr() 
returns a list.  So e.g. if

library(lme4)
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)


VarCorr(fm1)$Subject gives a 2x2 covariance matrix

cov2cor() will convert this to a correlation matrix.

Or, for lmer fits at least, the correlation is already present as an 
attribute:

attr(VarCorr(fm1)$Subject, "correlation")

On 2022-10-07 9:43 a.m., Sun, John wrote:
> Dear All,
> 
> I am writing to ask how to compute the (partial) autocorrelation of random-effects versus lag, and sample-variance covariance matrix of the random-effects given some data without specification of some model or structure on the random-effects covariance matrix.
> 
> Best regards,
> John
> 
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

-- 
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
(Acting) Graduate chair, Mathematics & Statistics
 > E-mail is sent at my convenience; I don't expect replies outside of 
working hours.



More information about the R-sig-mixed-models mailing list