Programming the statistical procedures from SAS

Proc mixed - LS-means adjusted for covariates

Reply
Regular Contributor
Posts: 158

Proc mixed - LS-means adjusted for covariates

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.

 

 

Respected Advisor
Posts: 3,000

Re: Proc mixed - LS-means adjusted for covariates

Show us the ouptut

--
Paige Miller
Regular Contributor
Posts: 158

Re: Proc mixed - LS-means adjusted for covariates

Posted in reply to PaigeMiller

Untitled.png

PROC Star
PROC Star
Posts: 401

Re: Proc mixed - LS-means adjusted for covariates

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. 

Ask a Question
Discussion stats
  • 3 replies
  • 146 views
  • 1 like
  • 3 in conversation