重復測量 - GLM


重復測量是多水平模型的一種。

Repeated measures refer to multiple measurements taken from the same experimental unit, such as serial evaluations over time on the same patient。

對一個試驗單元進行多次測量,就是重復測量。例如在不同時間對同一個病人進行測量,這種情況下收集的數據叫做‘longitudinal’ data縱向數據。

或者說某個反應變量測量了多次。這個多次就是重復。例如res在VISIT 1 3 5各測一次,或者在Period A測一次,Period  B測一次。

說白了就是within-subject factors在所有個體中都是相同的。個體是最基本的研究對象,是在個體基礎上搜集數據,展開研究。

 

Mix: can accommodate missing data and a rich palette of assumptions regarding the covariance structure

1.  為啥不用多因素方差分析?

因為多因素方差分析要求obervation independent. 也就是觀測獨立。

2. Notice that the response might vary among groups, among patients within groups, and among the different measurement times. Therefore, you include a Group effect, a Patient (within Group) effect, and a Time effect as sources of variation in the ANOVA. In addition, the repeated measures analysis using a univariate approach includes the Group-by-Time interaction。

不同影響因素的response不同,所以需要考慮這些因素。

However, because of the correlation of measurements over time from the same patient, a Patient effect must be included as a source of variation in the ANOVA table。

因為同一patient,不同時間測量之間具有相關性,所以需要patient effect.

3. In addition, the univariate ANOVA requires that each pair of repeated measures has the same correlation, a feature known as ‘compound symmetry’.

假設each pair of repeated measures中相關性相同。

4. A significant interaction between the Group and Time effects means that changes in response over time differ among groups.

GROUP-BY-TIME的意思: 隨時間推移,response在不同group之間變化量/改變量/增量不同(圖3和圖4),也就是變化不一致。

 

 

 這張圖說白了:Time和Drug都對Response有影響,但不能用多因素方差分析,因為觀測間不獨立,是對同一個人不同時間點的測量,所以需要把Time 和 patient(group)的方差給分解出來。

5. 方差分解

 

FG的意思: 不同group之間是否顯著不同,相當於所有VISIT被取了均值。

FT的意思:合並group后,不同VISIT之間是否不同。

FGT意思:隨時間推移,response在不同group之間不同。

 

 6. 計算公式:

Patient(group): 用每個patient的均值減去group均值,*所在cell的觀測數(也就是重復測量次數),的平方和。這就是組內誤差

Group: 每個group的均值減去總均值,*所在cell的觀測數,的平方和,

Time:每個timepoint均值減去總均值,*所在cell的觀測數,的平方和,

group-by-time: 每個group每個timepoint的均值減去總均值,*所在cell的觀測數,的平方和 ,減去 group 減去 time,說明group 單位效應隨着時間發生了變化。

總:每個測量值減去總均值的平方和

 

上述公式是組間誤差除以組內誤差,此時組內誤差是MS patient(gruop)。

Time 和 GROUP-by-Time是對應的MS除以殘差。

 

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;
ods html;

proc print data = discom; 
 var vacgrp pat visit score;
 title1 'Repeated-Measures ANOVA';
 title2 'Example 8.1: Arthritic Discomfort Following Vaccine';
run;
 
proc glm data = discom;
*類別變量必須寫在CLASS語句中;
 class vacgrp pat visit; 
 model score = vacgrp pat(vacgrp) visit vacgrp*visit/ss3;
 *雖然指定成了隨機效應,但仍然是按照固定效應算的,參照計算公式;
 random pat(vacgrp);
 *指定假設和誤差, 否則SAS自動把Error當作分母;
 test h=vacgrp e=pat(vacgrp); 
 quit;
run;

  

 

 

第一部分是變量和值水平

第二部分是模型整體有沒有意義,和殘差

第三部分:

vacgrp在此處無意義,因為是重復測量,需要考慮visit,但這沒考慮。

pat(vacgrp)也不需要看,雖說是隨機效應,但這處理成了固定效應。

后兩行正常分析。

最后一行是說:difference between treatments is time-related。不同treatment之間的差異和時間相關。

 

 

 

是說:null hypothesis of no Vaccine Group effect。也就是組間變異/隨機誤差,差異不顯著。

 


免責聲明!

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



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