BookmarkSubscribeRSS Feed
mtaba
Calcite | Level 5

Hi,

 

I am trying to compare 3 groups of measurements that have dependencies at multiple levels. Here is a part of the data:

 

IDCaseGroupOutcome
ID11A0.45
ID21A6.52
ID31A2.57
ID32A1.08
ID41A0.24
ID42A0.46
ID43A0.16
ID51A1.47
ID61A0.78
ID11B1.19
ID21B1.33
ID31B3.37
ID32B2.95
ID41B0.67
ID42B0.03
ID43B0.33
ID51B0.12
ID61B1.40
ID11C0.55
ID21C0.07
ID31C1.32
ID32C0.46
ID41C0.30
ID42C0.02
ID43C0.14
ID51C0.00
ID61C0.03

 

Each ID indicates one of the participants in the study. Each participant has done multiple measurements (say measurements 1, 2, 3, and 4). Each case indicates the analysis performed using a combination of 3 of the measurements (e.g., case 1= measurements 1, 2, and 3; case 2= measurements 1, 2, and 4). Please note that some of the participants only have 1 case, while some others have more than 1 case, with an unequal number of cases between participants.

 

Each group is created from a pair of measurements (e.g., Group A for Case 1 of ID 1 is computed by analyzing Measurements 1 and 3). For each case, there are 3 groups (i.e., all possible combinations of 3 measurements).

 

My goal is to compare the outcome between different groups (i.e., A, B, and C). However, the problem is that I cannot run a repeated measures ANOVA, since the observations (i.e., Cases in this dataset) are not independent, since they come from the same participant.

 

BTW, in my complete dataset, the number of cases is 21, while the number of participants is 6.

 

My solution to this problem was to run a mixed model with nested random effects. The fixed effect would be the "Group", and the random effects will be "Cases" nested within "ID". Here is how I coded this in SAS:

 

proc mixed data=data PLOTS=All;
	class ID Group Case;
	model Outcome = Group/ ddfm=kr solution CL;
	random Case(ID); 
	repeated / group=Group subject = Case(ID);
	lsmeans Group/pdiff cl adjust=Tukey;
	ods output solutionf=sf(keep=effect estimate  
                                 rename=(estimate=overall));
	run;

 

My first question is: "Is the model defined properly based on the description of the data structure I provided?

 

Second question: "How can I perform pairwise paired comparisons between different groups in case the Fixed effect is significant? This question is because I cannot perform paired t-test with the assumption of the independence of observations being violated. LSMEANS also doesn't work because it compares the differences in the means, while I need to compare the mean of the differences.

 

Thanks in advance for your help!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 459 views
  • 0 likes
  • 1 in conversation