重復測量 - MIXED混合模型


重復測量GLM中說到,隨機效應那是被處理成了固定效應,而不是真正的隨機效應。

1. GLM處理重復測量時的缺點

The assumption of compound symmetry required by the ‘univariate’ approach just discussed means that the correlation between a measurement at Time i and any other measurement within the same patient, say at Time j, is the same for all i and j.

假設復合對稱,就是同一個patient,任意兩個測量點之間的相關關系是相同的。這個假設很苛刻,尤其是有多個測量時間點時。

2. Mixed Model

上述問題,Mixed模型中可通過 TYPE = ,根據需求指定。

 

 如果TYPE = UN: 兩兩比較,C42加上4個方差。因為這是假設任意兩個協方差都不一致。

 The  R matrix is, therefore, block diagonal with 27 blocks, each block consisting of identical 4 x 4 unstructured matrices. The 10 parameters of these unstructured blocks make up the covariance parameters estimated by maximum likelihood

  如果TYPE = CS: 就是2個參數。協方差全都相同(只有一個),只有一個方差,一個協方差。

 

 

 第一塊是第一個人有四條觀測,第二塊是第二個人有兩條觀測,第三塊是第三個人有三個觀測。

data arthr;

input vacgrp $ pat mo1 mo2 mo3;
datalines;
ACT 101 6 3 0 
ACT 103 7 3 1 
ACT 104 4 1 2 
ACT 107 8 4 3
PBO 102 6 5 5 
PBO 105 9 4 6 
PBO 106 5 3 4 
PBO 108 6 2 3 
;

data discom; set arthr;
keep vacgrp pat visit score;
score = mo1; visit = 1; output;
score = mo2; visit = 2; output;
score = mo3; visit = 3; output;
run;

proc mixed data = discom;
class vacgrp pat visit;
*包含兩個固定效應和一個交互效應;
model score = vacgrp visit vacgrp*visit;
*表明visits represent repeated measures within pat(vacgrp).;
repeated visit / subject=pat(vacgrp) type=un r rcorr;

*diff相當於兩樣本t檢驗,

slice相當於分組檢驗,by visit

如果都不加,相當於單樣本t檢驗,均值不等於0得檢驗

;
lsmeans vacgrp visit vacgrp*visit / diff slice = visit;
estimate 'Month 3 Change from Baseline: ACT v. PBO'
vacgrp * visit -1 0 1 1 0 -1;
run;

repeated visit / subject=pat(vacgrp)

意思是visit代表pat() 中重復測量。visits represent repeated measures within pat(vacgrp)

 

 

 1.是說當使用TYPE = 時,是否比ANOVA殘差獨立提供更好的擬合。provides a better fit compared with the ANOVA independent errors case (i.e., zero correlation).

 2. 是具體的分析

G矩陣:Covariance Parameters: 就是Max Obs per Subject中兩兩比較,再加上3個Variance。

X:固定效應的變量數目,2+3+2*3+1,ACT PB0是2,VISIT1-3是3,兩者相乘是2*3,再加個1殘差

Z:為0是因為這沒有指定隨機效應。

Max Obs per Subject: 每個Subject幾個觀測

 

 R和RCORR to get an idea of any patterns that might exist in the correlations across time。

可通r Rcorr,看下是否和TYPE中指定的協方差結構吻合。這里的協方差就是任意兩個時點(VISIT)的關系

 

 Estimate就是最小二乘均值,Standard Error是標准誤,后面的t分數是Estimate / Standard Error。也就是單樣本 t 檢驗。

 

 

 兩樣本 t 檢驗。

 

 

 相當於by visit,方差分析。

 

 兩個group之間的chage比較

參考 SAS estimate 或 contrast

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM