Hi there,
I just got below code, does anyone can help explain a little bit on the matrix following lsmestimate statement.
What does the matrix stands for?
From statistical perspective, how to explain the matrix? Thanks!
you could simply set time has 4 values like 1 ,2, 3, 4
trt has 2 values as 'A' 'B'
subgroup has 3 values as 'High' 'Low' 'Mid'
proc mixed data = test method = reml order = internal cl covtest;
class id time trt (ref = 'A') subgroup ;
model CHANGE = BASE*time trt*time*subgroup / solution ddfm=KR singular=1e-10;
repeated time / type=un subject=id;
lsmeans trt*time*subgroup / pdiff om cl alpha=0.05;
lsmestimate trt*time*subgroup
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
-2 1 1 2 -1 -1,
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
1 -2 1 -1 2 -1,
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
1 1 -2 -1 -1 2 /divisor=3 joint elsm cl e alpha=0.05;
run;
The documentation for the LSMESTIMATE statement explains the meaning of the values.
I suggest you start by understanding the ideas for a single categorical variable, then try to understand a two-way interaction.
Your example shows a three-way interaction. There are three separate estimates specified. Each estimate involves 24 (=4*2*3) coefficients. The three estimates are separated by commas.
In addition to the doc, I recommend "CONTRAST and ESTIMATE Statements Made Easy: The LSMESTIMATE Statement"
by Kiernan, Tobias, Gibbs, and Tao (2001)
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.