在重複測量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;
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. 是具體的分析
Max Obs per Subject: 每個Subject幾個觀測
Covariance Parameters: 就是Max Obs per Subject中兩兩比較,再加上3個Variance。
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
本文來自部落格園,作者:Iving,轉載請注明原文連結:https://www.cnblogs.com/SAS-T/p/15540149.html