|Date: ||Wed, 17 Mar 2010 13:07:48 -0700|
|Reply-To: ||David J Moriarty <djmoriarty@CSUPOMONA.EDU>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||David J Moriarty <djmoriarty@CSUPOMONA.EDU>|
|Subject: ||Re: Help with writing PROC GLM / Repeated statements|
|In-Reply-To: ||<firstname.lastname@example.org >|
|Content-Type: ||text/plain; charset="us-ascii"; format=flowed|
In the PROC MIXED code, you have response variable "fever" that I
didn't find in the data description, so I'm unsure where that value originates.
You would need to input the data using an input statement something like:
input drug H1 H2 H3 H4 H5 H6 H7 H8;
or write some code (there are examples in the SAS help) to convert
the data structure used in MIXED to that used in GLM.
Since you may be doing a contrast on the within-subjects factor, you
might consider one of the contrasts designed for that situation. I've
put the code for the polynomial contrast below; and included printe
to provide the sphericity test.
You can get some info on the time required for the procedures in the
log. Unless you have an enormous data set, it shouldn't be much of a
factor. May be affected more by other things your cpu is doing rather than SAS.
The following may get you started.
model H1 H2 H3 H4 H5 H6 H7 H8 = drug / nouni;
repeated hour polynomial / summary printe;
At 12:45 PM Wednesday 3/17/2010, Chung Y. Li wrote:
>On Wed, Mar 17, 2010 at 9:01 AM, Chung Y. Li <email@example.com> wrote:
> > Hello,
> > I'd like to compare the results of PROC MIXED against those of PROC
> > GLM, and also the time required to run the two procedures.
> > I have a PROC MIXED repeated measures model for testing; however, I
> > have a hard time converting it into equivalent PROC GLM.
> > (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.
> > (PROC MIXED Code)
> > proc mixed data=modelset;
> > class drug hour patient;
> > model fever=drug|hour;
> > repeated hour / subject=patient(drug) type=UN;
> > *--- construct pre (hours 1-4) and post (hour 5-8) period
> > * (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;
> > run;
> > Thanks.
> > Susie C Y Li
David J. Moriarty, Ph.D.
Professor and Graduate Coordinator
Biological Sciences Department
California State Polytechnic University
Pomona, CA 91768-2557 USA