BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kc
Obsidian | Level 7 kc
Obsidian | Level 7

I am running the following model to run a repeated measures ancova. the data has 2 treatment groups, 2 stratification levels and 5 time points (baseline, 1m, 6m, 12m, 24m). The dependent variable is the score at post-baseline time points (1,6,12,24 months).

My question is, how do I get an overall p-value for the 3-way interaction at each post-baseline timepoint? I am not sure of how to write a contrast statement to accomplish this? Please help!

 

proc mixed data=growth noclprint order=formatted covtest noitprint method=reml;
class group pt strata time(ref="1");
model score = baseline_score group time time*group strata group*strata time*strata time*group*strata/solution ddfm=bw notest;
random pt /vcorr;

lsmeans time*group*strata/pdiff cl ;

ods output SolutionF=est_(keep=effect estimate stderr probt)
LSMeans=lsm_(keep=effect group strata time estimate lower upper)
Diffs=diff_(keep=effect group strata _group _strata time _time estimate lower upper probt);
run;

1 ACCEPTED SOLUTION

Accepted Solutions
kc
Obsidian | Level 7 kc
Obsidian | Level 7

Here is a contrast statement that works: (you can write the statement for other time points in a similar fashion)

 

proc mixed data=growth noclprint order=formatted covtest noitprint method=reml;
class group pt strata time(ref="1");
model score = baseline_score group time time*group strata group*strata time*strata time*group*strata/solution ddfm=bw notest;
random pt /vcorr;

 

contrast 'pvalue at 1 month'
group*strata 1 -1 -1 1 time*group*strata 1 0 0 0 0 0 -1 0 0 0 0 0 -1 0 0 0 0 0 1 0 0 0 0 0;

 

lsmeans time*group*strata/pdiff cl ;

ods output Contrasts=cont_(keep=label probf)

SolutionF=est_(keep=effect estimate stderr probt)
LSMeans=lsm_(keep=effect group strata time estimate lower upper)
Diffs=diff_(keep=effect group strata _group _strata time _time estimate lower upper probt);
run;

View solution in original post

2 REPLIES 2
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Do you mean the interaction of group and strata at each value of time? In other words, a two-way interaction rather than three-way?

 

If so, then you can do this using the LSMESTIMATE statement, with the AT option to specify an appropriate value for baseline_score at which to estimate the lsmeans. It's worth taking the time to figure out how to use the nonpositional syntax for LSMESTIMATE. See

https://support.sas.com/resources/papers/proceedings11/351-2011.pdf

kc
Obsidian | Level 7 kc
Obsidian | Level 7

Here is a contrast statement that works: (you can write the statement for other time points in a similar fashion)

 

proc mixed data=growth noclprint order=formatted covtest noitprint method=reml;
class group pt strata time(ref="1");
model score = baseline_score group time time*group strata group*strata time*strata time*group*strata/solution ddfm=bw notest;
random pt /vcorr;

 

contrast 'pvalue at 1 month'
group*strata 1 -1 -1 1 time*group*strata 1 0 0 0 0 0 -1 0 0 0 0 0 -1 0 0 0 0 0 1 0 0 0 0 0;

 

lsmeans time*group*strata/pdiff cl ;

ods output Contrasts=cont_(keep=label probf)

SolutionF=est_(keep=effect estimate stderr probt)
LSMeans=lsm_(keep=effect group strata time estimate lower upper)
Diffs=diff_(keep=effect group strata _group _strata time _time estimate lower upper probt);
run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 5054 views
  • 0 likes
  • 2 in conversation