I have the below SAS code for a data with 2 groups (tx and control), time (continuous - including baseline at 0), and 2 covariates (cov1 is dichotomous and cov2 is continuous).
proc mixed data=dat;
class id tx (ref='0') cov1 (ref='0');
model y=time|tx cov1 cov2/s cl noint;
random intercept time/type=un sub=id;
estimate 'Control rate' time 1 time*tx 0 1/cl;
estimate 'Tx rate' time 1 time*tx 1 0/cl;
lsmeans tx /at time=0 cl;
run;
When I look at the lsmeans output, I see that it is forcing time to be 0 and cov2 to be some value that is the same for both tx levels, cov1 is not in the output. What is the value that lsmeans is setting cov2 to and why is cov1 omitted? How can I interpret this? My intention is to get the mean estimates of y at each tx at baseline (time=0) while adjusting for differences in cov1 and cov2.
Show us the ouptut
Unless you specify otherwise, the continuous covariate is set to its mean value. The lsmean is a marginal mean over a balanced population and roughly speaking averages over the levels of a categorical factor that is not specified in the LSMEANS statement.
See the LSMEANS documentation for more details.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.