turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- LSMEANS for average of 2 treatment groups?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-23-2014 06:04 AM

Hi,

I want to analyze a mixed model for repeated measurements at months 1,3,6,9,12,18,24. Treatments are active1 active2, and placebo. The model will be adjusted for the 3 quantitative (baseline, age, duration of disease) and 3 dichotomous factors. Month is intentionally modeled as a categorical factor.

PROC MIXED ORDER=internal;

CLASS patid trt month covar1 covar2 covar3;

MODEL y= month

age

disdur

trt trt*month

baseline baseline*month

covar1 covar1*month

covar2 covar2*month

covar3 covar3*month / S DDFM=KR;

REPEATED month / TYPE=un SUBJECT=patid;

LSMEANS trt*month covar1*month covar2*month covar3*month/ CL DIFF E;

I need to estimate LSM (s.e.) for the 3 treatment groups at Months 12 and Month 24. This I can do with a simple LSMEANS statement.

Question: How can I estimate the average LSM (s.e.) of the 2 active treatments?

The only way I can think of is to use the 'E' option in the LSMEANS statement to save the all covariates' coefficients used for constructing least square means, write the coefficients into macro variables, and then run the model again with a fairly complex ESTIMATE statement to derive the LSM of the pooled active treatments.

Does anybody have a simpler solution?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rolf

01-23-2014 06:39 AM

You will need SAS 9.3 or higher. The LSMESTIMATE statement "The LSMESTIMATE statement provides a mechanism for obtaining custom hypothesis tests among least squares means"

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rolf

01-23-2014 06:41 AM

OK, instead getting the coefficients for the quantitative outcomes from PROC MIXED I could retrieve them from PROC MEANS since the coefficients are the mean values.

Any ideas for an easier solution?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rolf

01-24-2014 12:59 PM

The timestamps seem to indicate you might have missed data_null's suggestion regarding LSMESTIMATE. It is the handiest tool in the mixed model procedures in my opinion.

Steve Denham

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SteveDenham

02-03-2014 09:46 AM

It seems that with LSMESTIMATE I can only get the overall LSM for trt 1&2 pooled but not the LSM at any level of a class variable. If I used time as a continuous covariate then

LSMESTIMATE trt 'Combined at M2' 0.5 0.5 0 / AT time=12;

probably would give me the estmate I want, but with timecat (instead time) as a class variable it doesn't work. Or am I missing something?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rolf

02-03-2014 10:07 AM

trt*month?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to data_null__

02-03-2014 10:31 AM

yes, after all

LSMESTIMATE trt*month 0 0 0 0.5 0 0

0 0 0 0.5 0 0

0 0 0 0 0 0;

gave the same result as the 21 rows ESTIMATE statement I have been using so far.

I had thought that with the LSMESTIMATE statement only 1 effect (i.e. trt, but not trt*month) could be specified because I misinterperted the following statement in the SAS documentation "*In contrast to a multirow estimate in the ESTIMATE statement, you specify only a single effect in the LSMESTIMATE statement*".

Thanks, now I can shorten the code.