06-11-2018 03:43 PM
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;
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.
06-12-2018 12:31 PM
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.