linear mixed effect modeling - hypotheses testing

1 view (last 30 days)
hello, I'm comparing between between and within person models and testing different hypotheses on the models (specified in H). My problem is that the coefTest results are identical in the between and within-person models, and I'm not sure what I'm doing wrong. I've compared the results with spss results, and they are identical in the between person model, but obviously the spss within-person model results are different. Thank you!
H =
1 0 0 0
1 0 1 0
1 1 0 0
1 1 1 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
% Conditional Between-Person Model
CBPM = fitlme(Data, 'outcome ~ time*group','FitMethod','REML');
for i = 1:length(H)
CBPM_tests(i) = coefTest(CBPM,H(i,:));
end
% Conditional Within-Person Model
CWPM = fitlme(Data, 'outcome ~ time*group + (1 | PersonID)','FitMethod','REML');
for i = 1:length(H)
CWPM_tests(i) = coefTest(CWPM,H(i,:));
end
spss syntax:
ECHO 'Conditional Between-Person Model'.
ECHO 'With Contrasts for Time and Group'.
MIXED outcome WITH time1 treat
/METHOD = REML
/PRINT = SOLUTION TESTCOV R
/FIXED = time1 treat time1*treat
/TEST = 'Mean: Control Group at Pre-Test' intercept 1 time1 0 treat 0 time1*treat 0
/TEST = 'Mean: Control Group at Post-Test' intercept 1 time1 1 treat 0 time1*treat 0
/TEST = 'Mean: Treatment Group at Pre-Test' intercept 1 time1 0 treat 1 time1*treat 0
/TEST = 'Mean: Treatment Group at Post-Test' intercept 1 time1 1 treat 1 time1*treat 1
/TEST = 'Time Effect for Control Group' time1 1 time1*treat 0
/TEST = 'Time Effect for Treatment Group' time1 1 time1*treat 1
/TEST = 'Group Effect at Pre-Test' treat 1 time1*treat 0
/TEST = 'Group Effect at Post-Test' treat 1 time1*treat 1
.
ECHO 'Conditional Within-Person Model'.
ECHO 'With Contrasts for Time and Group'.
MIXED outcome BY PersonID WITH time1 treat
/METHOD = REML
/PRINT = SOLUTION TESTCOV R
/FIXED = time1 treat time1*treat
/RANDOM = intercept | SUBJECT(PersonID)
/TEST = 'Mean: Control Group at Pre-Test' intercept 1 time1 0 treat 0 time1*treat 0
/TEST = 'Mean: Control Group at Post-Test' intercept 1 time1 1 treat 0 time1*treat 0
/TEST = 'Mean: Treatment Group at Pre-Test' intercept 1 time1 0 treat 1 time1*treat 0
/TEST = 'Mean: Treatment Group at Post-Test' intercept 1 time1 1 treat 1 time1*treat 1
/TEST = 'Time Effect for Control Group' time1 1 time1*treat 0
/TEST = 'Time Effect for Treatment Group' time1 1 time1*treat 1
/TEST = 'Group Effect at Pre-Test' treat 1 time1*treat 0
/TEST = 'Group Effect at Post-Test' treat 1 time1*treat 1

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!