Hi,
I am running a mixed model for a repeated measures analysis. I have two groups, with each group having 3 times points. I know how to use syntax to do comparisons between individual group*time interactions, such as group1*time1 - group2*time2. What I am trying to do, and struggling with, is how to code the contrasts of (group1*time3 - group1*time1) - (group2*time3-group2*time1). Thanks! |
The TEST statement is your friend. Search the SPSS-L archives for many examples: Ryan Sent from my iPhone
|
In reply to this post by londonda
The code BELOW my name generates data that conform to a 2 (conditions) X 3 (time points) linear mixed model with a compound symmetric structure to the residual variance-covariance matrix, after which the linear mixed model is employed on the simulated data via the MIXED procedure, along with the various TEST statements of interest.
Ryan -- *Generate data. set seed 65923454. new file. inp pro. comp subject = -99.
comp condition = -99. comp time = -99. leave subject to time. loop subject= 1 to 1000. compute condition = rv.bernoulli(.50). compute #random_effect = sqrt(.30)*rv.normal(0,1). loop time = 1 to 3. compute y = 1.0 + 2.0*(condition=0) + 2.5*(time=1) + 3.0*(time=2) + 3.5*(condition=0)*(time=1) + 4.0*(condition=0)*(time=2) + #random_effect + rv.normal(0,1). end case. end loop. end loop. end file. end inp pro. exe. *Recode condition. recode condition (0=1) (1=2). exe. *Fit Linear Mixed Model. MIXED y BY condition time /FIXED=condition time condition*time | SSTYPE(3) /METHOD=REML /REPEATED=time | SUBJECT(subject) COVTYPE(CS) /EMMEANS=TABLES(condition*time) /PRINT=SOLUTION /TEST 'mean(c1,t1)' intercept 1 condition 1 0 time 1 0 0 condition*time 1 0 0 0 0 0 /TEST 'mean(c1,t2)' intercept 1 condition 1 0 time 0 1 0 condition*time 0 1 0 0 0 0 /TEST 'mean(c1,t3)' intercept 1 condition 1 0 time 0 0 1 condition*time 0 0 1 0 0 0 /TEST 'mean(c2,t1)' intercept 1 condition 0 1 time 1 0 0 condition*time 0 0 0 1 0 0 /TEST 'mean(c2,t2)' intercept 1 condition 0 1 time 0 1 0 condition*time 0 0 0 0 1 0 /TEST 'mean(c2,t3)' intercept 1 condition 0 1 time 0 0 1 condition*time 0 0 0 0 0 1 /TEST 'Diff1: mean(c1,t1) MINUS mean(c1,t2)' intercept 0 condition 0 0 time 1 -1 0 condition*time 1 -1 0 0 0 0 /TEST 'Diff2: mean(c1,t1) MINUS mean(c1,t3)' intercept 0 condition 0 0 time 1 0 -1 condition*time 1 0 -1 0 0 0 /TEST 'Diff3: mean(c1,t2) MINUS mean(c1,t3)' intercept 0 condition 0 0 time 0 1 -1 condition*time 0 1 -1 0 0 0 /TEST 'Diff4: mean(c2,t1) MINUS mean(c2,t2)' intercept 0 condition 0 0 time 1 -1 0 condition*time 0 0 0 1 -1 0 /TEST 'Diff5: mean(c2,t1) MINUS mean(c2,t3)' intercept 0 condition 0 0 time 1 0 -1 condition*time 0 0 0 1 0 -1 /TEST 'Diff6: mean(c2,t2) MINUS mean(c2,t3)' intercept 0 condition 0 0 time 0 1 -1 condition*time 0 0 0 0 1 -1 /TEST 'Diff1 MINUS Diff4' intercept 0 condition 0 0 time 0 0 0 condition*time 1 -1 0 -1 1 0 /TEST 'Diff2 MINUS Diff5' intercept 0 condition 0 0 time 0 0 0 condition*time 1 0 -1 -1 0 1 /TEST 'Diff3 MINUS Diff6' intercept 0 condition 0 0 time 0 0 0 condition*time 0 1 -1 0 -1 1. On Mon, Mar 4, 2013 at 3:18 PM, londonda <[hidden email]> wrote: Hi, |
Thanks you so much! I look forward to analyzing the code so that I
understand how to do this analysis in the future. On 3/4/2013 4:39 PM, Ryan Black [via SPSSX Discussion] wrote: > MIXED y BY condition time > /FIXED=condition time condition*time | SSTYPE(3) > /METHOD=REML > /REPEATED=time | SUBJECT(subject) COVTYPE(CS) > /EMMEANS=TABLES(condition*time) |
Free forum by Nabble | Edit this page |