简体   繁体   English

如何在R中使用AR(1)随机效应相关结构拟合线性混合模型?

[英]How do you fit a linear mixed model with an AR(1) random effects correlation structure in R?

I am trying to use R to rerun someone else's project, so we need to use some macros in R. 我正在尝试使用R重新运行其他人的项目,因此我们需要在R中使用一些宏。

Here comes a very basic question: 这是一个非常基本的问题:

m1.nlme = lme(log.bp.dia ~ M25.9to9.ma5iqr + temp.c.9to9.ma4iqr + o3.ma5iqr + sea_spring + sea_summer + sea_fall + BMI + male + age_ini, data=barbara.1.clean, random = ~ 1|study_id)

Since the model is using AR(1) [autocorrelation 1 covariance model] in SAS for within person variance, I am not sure how to do this in R. 由于该模型使用SAS中的AR(1)[自相关1协方差模型]进行人员差异,因此我不确定如何在R中执行此操作。

And where I can see the index for different models, like unstructured? 在哪里可以看到不同模型(例如非结构化模型)的索引?

Thanks 谢谢

我不知道不同模型的“索引”是什么意思,但是要为残差指定AR(1)协方差结构,可以将corr=corAR1()添加到lme调用中。

The correlation at lag $1$ is say $r$, where $-1< r <1$ for a stationary $AR(1)$ model. 滞后$ 1 $的相关性为$ r $,其中对于静态$ AR(1)$模型,$-1 <r <1 $。 The correlation at lag $k \\geq 1$ is $r^k$. 滞后$ k \\ geq 1 $的相关值为$ r ^ k $。 This gives you the autocovariance matrix by just multiplying by the variance of $X_t$. 通过乘以$ X_t $的方差,可以得到自协方差矩阵。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM