From: Dale McLerran on
--- On Thu, 2/25/10, Chung Y. Li <li.chungying(a)GMAIL.COM> wrote:

> From: Chung Y. Li <li.chungying(a)GMAIL.COM>
> Subject: How to specify the ESTIMATE statement in PROC MIXED
> To: SAS-L(a)LISTSERV.UGA.EDU
> Date: Thursday, February 25, 2010, 4:34 PM
> Hello,
> I am fitting a PROC MIXED repeated measures model, and trying to
> estimate some linear combinations of the simple effects of interest to
> me.
>
> (Data) I have 2 drugs (A and B), and gave them to patients randomly in
> a trial, then measured their temperatures every hour for 8 hours.
>
> (SAS Code)
>
> proc mixed data=modelset;
> class drug hour patient;
> model fever=drug|hour;
> repeated hour / subject=patient(drug) type=toep;
> *--- construct pre (hours 1-4) and post (hour 5-8) period estimates--;
>
> * (1) testing pre vs post: drug A;
> estimate "drug A: (pre-post) difference"
> hour 1 1 1 1 -1 -1 -1 -1
> drug*hour 1 1 1 1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 / divisor=4;
>
> * (2) testing pre vs post: drug B;
> estimate "drug B: (pre-post) difference"
> hour 1 1 1 1 -1 -1 -1 -1
> drug*hour 0 0 0 0 0 0 0 0 1 1 1 1 -1 -1 -1 -1 / divisor=4;
>
> * (3) testing pre vs post: drug A vs drug B;
> estimate "drug A vs drug B: (pre-post) difference"
> hour 1 1 1 1 -1 -1 -1 -1
> drug*hour 1 1 1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1/ divisor=8;
>
> run;
>
> Estimates (1) and (2) gave me the desired results. However, estimate
> (3) comes back un-estimable. Can anyone help?
>
> Also, does anyone know how to suppress PROC MIXED from printing the
> numerous levels of class - I got pages and pages of patients which I
> don't care.
>
> Susie C Y Li
>

Susie,

In order to obtain the linear combination for the difference
between drugs A and B, you should take the difference of the
linear combination coefficients. You actually do that for
the drug*hour interaction. However, the hour effect portion
of the linear combination is not correct. The hour portion
should become all zero values. Thus, the correct form for
the estimate of the difference between the two drugs should be:

estimate "drug A vs drug B: (pre-post) difference"
drug*hour 1 1 1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1/ divisor=8;

Dale

---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra(a)NO_SPAMfhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
From: "Chung Y. Li" on
Dale,

Thank you. The estimate works.

Any idea of suppressing PROC MIXED from printing volumes of class
levels (in this case, patient ID) data?

Susie

On Thu, Feb 25, 2010 at 8:38 PM, Dale McLerran <stringplayer_2(a)yahoo.com> wrote:
> --- On Thu, 2/25/10, Chung Y. Li <li.chungying(a)GMAIL.COM> wrote:
>
>> From: Chung Y. Li <li.chungying(a)GMAIL.COM>
>> Subject: How to specify the ESTIMATE statement in PROC MIXED
>> To: SAS-L(a)LISTSERV.UGA.EDU
>> Date: Thursday, February 25, 2010, 4:34 PM
>> Hello,
>> I am fitting a PROC MIXED repeated measures model, and trying to
>> estimate some linear combinations of the simple effects of interest to
>> me.
>>
>> (Data) I have 2 drugs (A and B), and gave them to patients randomly in
>> a trial, then measured their temperatures every hour for 8 hours.
>>
>> (SAS Code)
>>
>> proc mixed data=modelset;
>> class drug hour patient;
>> model fever=drug|hour;
>> repeated hour / subject=patient(drug) type=toep;
>> *--- construct pre (hours 1-4) and post (hour 5-8) period estimates--;
>>
>> * (1) testing pre vs post: drug A;
>> estimate "drug A: (pre-post) difference"
>> hour 1 1 1 1 -1 -1 -1 -1
>> drug*hour 1 1 1 1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 / divisor=4;
>>
>> * (2) testing pre vs post: drug B;
>> estimate "drug B: (pre-post) difference"
>> hour 1 1 1 1 -1 -1 -1 -1
>> drug*hour 0 0 0 0 0 0 0 0 1 1 1 1 -1 -1 -1 -1 / divisor=4;
>>
>> * (3) testing pre vs post: drug A vs drug B;
>> estimate "drug A vs drug B: (pre-post) difference"
>> hour 1 1 1 1 -1 -1 -1 -1
>> drug*hour 1 1 1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1/ divisor=8;
>>
>> run;
>>
>> Estimates (1) and (2) gave me the desired results. However, estimate
>> (3) comes back un-estimable. Can anyone help?
>>
>> Also, does anyone know how to suppress PROC MIXED from printing the
>> numerous levels of class - I got pages and pages of patients which I
>> don't care.
>>
>> Susie C Y Li
>>
>
> Susie,
>
> In order to obtain the linear combination for the difference
> between drugs A and B, you should take the difference of the
> linear combination coefficients. You actually do that for
> the drug*hour interaction. However, the hour effect portion
> of the linear combination is not correct. The hour portion
> should become all zero values. Thus, the correct form for
> the estimate of the difference between the two drugs should be:
>
> estimate "drug A vs drug B: (pre-post) difference"
> drug*hour 1 1 1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1/ divisor=8;
>
> Dale
>
> ---------------------------------------
> Dale McLerran
> Fred Hutchinson Cancer Research Center
> mailto: dmclerra(a)NO_SPAMfhcrc.org
> Ph: (206) 667-2926
> Fax: (206) 667-5977
> ---------------------------------------
>
From: Dale McLerran on
--- On Thu, 2/25/10, Chung Y. Li <li.chungying(a)GMAIL.COM> wrote:

> From: Chung Y. Li <li.chungying(a)GMAIL.COM>
> Subject: Re: How to specify the ESTIMATE statement in PROC MIXED
> To: SAS-L(a)LISTSERV.UGA.EDU
> Date: Thursday, February 25, 2010, 7:38 PM
> Dale,
>
> Thank you. The estimate works.
>
> Any idea of suppressing PROC MIXED from printing volumes of
> class
> levels (in this case, patient ID) data?
>
> Susie
>

You can suppress printing of all of that class information
through the NOCLPRINT option on the PROC statement. If you
specify

proc mixed data=mydata noclprint;

then no class information is printed. However, you might want
to see the class levels for variables which appear as effects
but suppress printing of class levels for your subject variable.
For that, you can use the form

proc mixed data=mydata noclprint=10;

or something similar. Variables which have more than 10 levels
would not appear in the list of levels of class variables.

Dale

---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra(a)NO_SPAMfhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
From: "Chung Y. Li" on
Dale,

Thank you. This is very helpful information.

Just out of curiosity, how do I specify these estimates if I were to
use PROC GLM instead?

Susie

On Fri, Feb 26, 2010 at 12:00 AM, Dale McLerran
<stringplayer_2(a)yahoo.com> wrote:
> --- On Thu, 2/25/10, Chung Y. Li <li.chungying(a)GMAIL.COM> wrote:
>
>> From: Chung Y. Li <li.chungying(a)GMAIL.COM>
>> Subject: Re: How to specify the ESTIMATE statement in PROC MIXED
>> To: SAS-L(a)LISTSERV.UGA.EDU
>> Date: Thursday, February 25, 2010, 7:38 PM
>> Dale,
>>
>> Thank you. The estimate works.
>>
>> Any idea of suppressing PROC MIXED from printing volumes of
>> class
>> levels (in this case, patient ID) data?
>>
>> Susie
>>
>
> You can suppress printing of all of that class information
> through the NOCLPRINT option on the PROC statement. If you
> specify
>
> proc mixed data=mydata noclprint;
>
> then no class information is printed. However, you might want
> to see the class levels for variables which appear as effects
> but suppress printing of class levels for your subject variable.
> For that, you can use the form
>
> proc mixed data=mydata noclprint=10;
>
> or something similar. Variables which have more than 10 levels
> would not appear in the list of levels of class variables.
>
> Dale
>
> ---------------------------------------
> Dale McLerran
> Fred Hutchinson Cancer Research Center
> mailto: dmclerra(a)NO_SPAMfhcrc.org
> Ph: (206) 667-2926
> Fax: (206) 667-5977
> ---------------------------------------
>
From: Robin R High on
Why would you want to apply GLM when it very likely can't handle the
repeated measures covariance nearly as well as MIXED or GLIMMIX?

With that in mind, it is helpful to compare the new LSMESTIMATE statement
with GLIMMIX, that replicates the ESTIMATE statements with less coding (in
other cases, considerably less):

ODS SELECT ESTIMATES LSMESTIMATES;

proc GLIMMIX data=modelset;
class drug hour patient;
model fever=drug|hour / ddfm=kr;
RANDOM hour / subject=patient(drug) type=toep RESIDUAL;

*--- construct pre (hours 1-4) and post (hour 5-8) period estimates--;

* (1) testing pre vs post: drug A;
estimate "drug A: (pre-post) difference" hour 1 1 1 1 -1 -1 -1 -1
drug*hour 1 1 1 1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 / divisor=4;

* (2) testing pre vs post: drug B;
estimate "drug B: (pre-post) difference" hour 1 1 1 1 -1 -1 -1 -1
drug*hour 0 0 0 0 0 0 0 0 1 1 1 1 -1 -1 -1 -1 / divisor=4;

* (3) testing pre vs post: drug A vs drug B;
* steps to the final result;
estimate "1 drug A: pre" intercept 4 drug 4 0 0 hour 1 1 1 1 0 0
0 0 drug*hour 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 / divisor=4;
estimate "2 drug A: post" intercept 4 drug 4 0 0 hour 0 0 0 0 1 1
1 1 drug*hour 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 / divisor=4;
estimate "3= 1-2 drug A: pre-post" hour 1 1 1 1 -1 -1 -
1 -1 drug*hour 1 1 1 1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 / divisor=4;
estimate "4 drug B: pre" intercept 4 drug 0 4 0 hour 1 1 1 1 0 0
0 0 drug*hour 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 / divisor=4;
estimate "5 drug B: post" intercept 4 drug 0 4 0 hour 0 0 0 0 1 1
1 1 drug*hour 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 / divisor=4;
estimate "6=4-5 drug B: pre-post" hour 1 1 1 1 -1 -1 -
1 -1 drug*hour 0 0 0 0 0 0 0 0 1 1 1 1 -1 -1 -1 -1 / divisor=4;
estimate "7=3-6: drug A vs drug B: (pre-post) difference" drug*hour 1
1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1/ divisor=8;


LSMESTIMATE drug*hour '3 drug A: pre-post' 1 1 1 1 -1 -1 -1 -1 0 0 0
0 0 0 0 0 / divisor=4;
LSMESTIMATE drug*hour '6 drug B: pre-post' 0 0 0 0 0 0 0 0 1 1 1
1 -1 -1 -1 -1 / divisor=4;
LSMESTIMATE drug*hour '7 drg A vs drg B: (pre-post) diff' 1 1 1 1 -1 -1
-1 -1 -1 -1 -1 -1 1 1 1 1 / divisor=8;

run;

Robin High
UNMC






From:
"Chung Y. Li" <li.chungying(a)GMAIL.COM>
To:
SAS-L(a)LISTSERV.UGA.EDU
Date:
02/26/2010 08:58 AM
Subject:
Re: How to specify the ESTIMATE statement in PROC MIXED
Sent by:
"SAS(r) Discussion" <SAS-L(a)LISTSERV.UGA.EDU>



Dale,

Thank you. This is very helpful information.

Just out of curiosity, how do I specify these estimates if I were to
use PROC GLM instead?

Susie

On Fri, Feb 26, 2010 at 12:00 AM, Dale McLerran
<stringplayer_2(a)yahoo.com> wrote:
> --- On Thu, 2/25/10, Chung Y. Li <li.chungying(a)GMAIL.COM> wrote:
>
>> From: Chung Y. Li <li.chungying(a)GMAIL.COM>
>> Subject: Re: How to specify the ESTIMATE statement in PROC MIXED
>> To: SAS-L(a)LISTSERV.UGA.EDU
>> Date: Thursday, February 25, 2010, 7:38 PM
>> Dale,
>>
>> Thank you. The estimate works.
>>
>> Any idea of suppressing PROC MIXED from printing volumes of
>> class
>> levels (in this case, patient ID) data?
>>
>> Susie
>>
>
> You can suppress printing of all of that class information
> through the NOCLPRINT option on the PROC statement. If you
> specify
>
> proc mixed data=mydata noclprint;
>
> then no class information is printed. However, you might want
> to see the class levels for variables which appear as effects
> but suppress printing of class levels for your subject variable.
> For that, you can use the form
>
> proc mixed data=mydata noclprint=10;
>
> or something similar. Variables which have more than 10 levels
> would not appear in the list of levels of class variables.
>
> Dale
>
> ---------------------------------------
> Dale McLerran
> Fred Hutchinson Cancer Research Center
> mailto: dmclerra(a)NO_SPAMfhcrc.org
> Ph: (206) 667-2926
> Fax: (206) 667-5977
> ---------------------------------------
>
 |  Next  |  Last
Pages: 1 2
Prev: Import Error
Next: SURVEYREG