Presentation is loading. Please wait.

Presentation is loading. Please wait.

G Lecture 5 Example fixed Repeated measures as clustered data

Similar presentations


Presentation on theme: "G Lecture 5 Example fixed Repeated measures as clustered data"— Presentation transcript:

1 G89.2247 Lecture 5 Example fixed Repeated measures as clustered data
Clusters as random effects Intraclass correlation ANOVA approach PROC MIXED Approach G Lecture 5

2 Whoops! A Mistake Fixed Checking data is important
Preparing charts for today alerted us to the fact that POMS in the Comparison Group was on a 1-5 scale, while the Bar Exam Group was 0-4. G Lecture 5

3 Repeated Measures as Clustered Data
There are many examples when clusters of data are collected Siblings within a family Children within a classroom Households within a Primary Sampling Unit Repeated measures are a special case of clustered data Times within a person But ... measurements are ordered by time G Lecture 5

4 Thinking generally about clusters
Suppose we sampled study groups of size four Each group has four measurement (persons in this case) Measurements are not usually ordered Observations within a cluster may be more similar than observations sampled across clusters If we have 135 study groups, is it fair to analyze the 135*4=540 persons as though they were independent observations? G Lecture 5

5 Clusters as Random Effects
Sampling clusters are often considered to be Random Effects Clusters are informative about overall population Actual choice of a specific cluster is due to chance Cluster effects are best thought in variance terms Snijders and Bosker call the clusters Macro level units Elements within the cluster are called Micro level units G Lecture 5

6 A One-way Random Effects Model
According to S&B, the observation Y for the ith observation in the jth cluster (macro level) is Yij = m + Uj + Rij where m is the overall mean of the population, Uj is the effect of randomly selected macro-unit j Rij is the effect of randomly selected micro-unit i in randomly selected macro-unit j. Define Var(Uj) = t2, Var(Rij) = s2, Var(Yij) = t2 + s2 (assuming Corr(U,R)=0) Bryk and Raudenbush notation (sort of) A randomly chosen observation varies as a function of cluster variation and within cluster variation. G Lecture 5

7 One-way random effects interpreted
Yij = m + Uj + Rij Suppose clusters are monozygotic twins and Y is a measure of eye color All of the variation in Y would be due to between twin effects (macro-unit U). R would reflect measurement error only Suppose clusters were pairings of persons who report for subject pool studies There might be some cluster effects due to subtle personality differences in when people volunteer, but most variation in Y would be due to micro-unit R G Lecture 5

8 How much of Var(Y) is due to Macro-level variation?
The Intraclass correlation is used to quantify how much of Var(Y) is due to Var(U). Assume we can get estimates of Var(U)=t2 and Var(R)=s2. These will come from either ANOVA or special software. ICC = r = t2/(t2 + s2) G Lecture 5

9 ICC interpreted as a correlation
The correlation between any two observations within a cluster U*j r r Y*1j Y*2j Corr(Y1j, Y2j)= r G Lecture 5

10 Example of ICC from ANOVA
Suppose we consider the 135 persons from the examinee and comparison groups to be clusters with four replications Ignore the ordering of replications Let's think of the replications as random effects SPSS Reliability can give us the estimate of Intraclass Correlation G Lecture 5

11 SPSS example RELIABILITY /VARIABLES=week1 week2 week3 week4
/SCALE(persons)=ALL/MODEL=ALPHA /STATISTICS=DESCRIPTIVE SCALE ANOVA /ICC=MODEL(ONEWAY) CIN=95 TESTVAL=0 . G Lecture 5

12 Analysis of Variance Table
Source of Variation Sum of Sq DF Mean Square F Prob. Between People Within People Between Measures Residual Total Grand Mean Intraclass Correlation Coefficient One-way random effect model: People Effect Random Single Measure Intraclass Correlation = 95.00% C.I.: Lower = Upper = F = DF = ( 134, ) Sig. = (Test Value = ) G Lecture 5

13 Where Are the Variance Estimates?
The ANOVA table shows where to get the estimate of Var(R)=s2. We use the "Within people" Mean Square, which is MSW=.1978. (S&B Eq. 3.10) To get Var(U)=t2 is a bit more work. E(MSB) = 4t2 + s2 Estimate(t2) = (MSB-MSW)/4 ( )/4 = .6166 ICC = .6166/( ) = .7572 G Lecture 5

14 Interpreting ICC In this example, 76% of the variance of the anxiety scores is due to macro-unit differences Some of the macro-unit variation may be due to examinee/comparison differences Within the comparison group the ICC is still .75 But the estimates of t2 and s2 are smaller than overall Within the examinee group the ICC is .59 The within macro-unit variance is relatively large in this case. G Lecture 5

15 Studying Random Effects using SAS PROC MIXED
The ANOVA procedure may be familiar, but it is not the easiest way to study the one way random effects model DATA anxgrps; infile 'bothanxst.dat'; input id 1-4 week 5-7 group 8-10 anx 11-15; id = id+100*group; *assign unique IDs to subjects; week=week-2.5; *center week at week 2.5; Proc sort; by id; Proc mixed covtest NOCLPRINT ; Class id; MODEL anx= /s; RANDOM Intercept /Subject=ID g; run; G Lecture 5

16 The Mixed Procedure Dimensions Covariance Parameters 2 Subjects 135
Max Obs Per Subject Observations Used Observations Not Used Total Observations Covariance Parameter Estimates Standard Z Cov Parm Subject Estimate Error Value Pr Z Intercept id <.0001 Residual <.0001 Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept <.0001 G Lecture 5

17 Comparison of Random Effects and Means
G Lecture 5

18 Extension 1: Fixed Cluster Effects
We can carry out the equivalent of a two sample t test. Group is a Fixed Effect Proc mixed covtest NOCLPRINT ; Class id; MODEL anx=group /s; RANDOM Intercept /Subject=ID g ; run; G Lecture 5

19 PROC MIXED Two Group Results
Covariance Parameter Estimates Standard Z Cov Parm Subject Estimate Error Value Pr Z Intercept id <.0001 Residual <.0001 Solution for Fixed Effects Standard Effect Estimate Error DF t Value Pr > |t| Intercept <.0001 group <.0001 G Lecture 5

20 Extension 2: Time, Group and Time-by-Group Considered
Proc mixed covtest; Class id; MODEL anx=week group group*week /s; RANDOM Intercept week /Subject=ID type=un g gcorr; run; G Lecture 5

21 PROC MIXED Results Row Effect id Col1 Col2 1 Intercept 1 1.0000 0.4222
Estimated G Correlation Matrix Row Effect id Col Col2 1 Intercept 2 week Covariance Parameter Estimates Cov Parm Subject Estimate S Error Z Value Pr Z UN(1,1) id <.0001 UN(2,1) id UN(2,2) id Residual <.0001 Solution for Fixed Effects Effect Estimate S Error DF t Value Pr > |t| Intercept <.0001 week <.0001 group <.0001 week*group <.0001 G Lecture 5

22 Creating a data File with One Line Per Observation in SPSS
write outfile='bothanxst.dat' records=4 /1 id 1-4 ' 1 ' sample 9-10 week1 (f5.2) /2 id 1-4 ' 2 ' sample 9-10 week2 (f5.2) /3 id 1-4 ' 3 ' sample 9-10 week3 (f5.2) /4 id 1-4 ' 4 ' sample 9-10 week4 (f5.2). execute. G Lecture 5

23 Reading a data file with four observations per line in SAS
data new; infile 'G2247_1.dat'; time=1; input id 1-4 group 5-6 supp output; time=2; input id 1-4 group 5-6 supp output; time=3; input id 1-4 group 5-6 supp output; time=4; input id 1-4 group 5-6 supp ; output; data new2; set new; week=time-2.5; id=id+100*group; G Lecture 5


Download ppt "G Lecture 5 Example fixed Repeated measures as clustered data"

Similar presentations


Ads by Google