Prev: Import Error
Next: SURVEYREG
From: "Chung Y. Li" on 26 Feb 2010 13:04 Robin and Dale, Thank you for your help and ideas. I have learned a great deal from your suggestions. I'm asked to run these estimates in all kinds of combinations and many iterations, and wonder if you can suggest some easy way for me to save the output estimates/standard errors/p-values automatically to files for reporting (probably via ODS)? Susie On Fri, Feb 26, 2010 at 11:55 AM, Robin R High <rhigh(a)unmc.edu> wrote: > 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 >> --------------------------------------- >> > > > >
From: Robin R High on 26 Feb 2010 14:10 Susie, I'd be extra careful about running it too carefree, though one can collect output stats with multiple runs with the ODS persist option: ods listing close; ods output estimates(persist=proc)=est tests3(persist=proc)=tst3; proc MIXED data=indat; ... run; proc MIXED data=indat; ... run; proc MIXED data=indat; ... run; ods output close; ods listing; proc print data=est; run; proc print data=tst3; run; You would then need to revisit the order ESTIMATE statements in the MIXED steps occur to see which sets of output belong to them -- and to make sure there are no nasty notes in the log file indicating something didn't work. Robin High UNMC From: "Chung Y. Li" <li.chungying(a)GMAIL.COM> To: SAS-L(a)LISTSERV.UGA.EDU Date: 02/26/2010 12:14 PM Subject: Re: How to specify the ESTIMATE statement in PROC MIXED Sent by: "SAS(r) Discussion" <SAS-L(a)LISTSERV.UGA.EDU> Robin and Dale, Thank you for your help and ideas. I have learned a great deal from your suggestions. I'm asked to run these estimates in all kinds of combinations and many iterations, and wonder if you can suggest some easy way for me to save the output estimates/standard errors/p-values automatically to files for reporting (probably via ODS)? Susie On Fri, Feb 26, 2010 at 11:55 AM, Robin R High <rhigh(a)unmc.edu> wrote: > 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 >> --------------------------------------- >> > > > >
From: "Chung Y. Li" on 26 Feb 2010 14:26
Robin, Points well taken. I'll be individually testing those estimates on random samples before running them against the larger sets. Susie On Fri, Feb 26, 2010 at 2:10 PM, Robin R High <rhigh(a)unmc.edu> wrote: > Susie, > > I'd be extra careful about running it too carefree, though one can collect > output stats with multiple runs with the ODS persist option: > > ods listing close; > ods output estimates(persist=proc)=est tests3(persist=proc)=tst3; > > proc MIXED data=indat; > .. > run; > proc MIXED data=indat; > .. > run; > proc MIXED data=indat; > .. > run; > > ods output close; > > ods listing; > > proc print data=est; run; > proc print data=tst3; run; > > > You would then need to revisit the order ESTIMATE statements in the MIXED > steps occur to see which sets of output belong to them -- and to make sure > there are no nasty notes in the log file indicating something didn't work. > > Robin High > UNMC > > > > > > > From: > "Chung Y. Li" <li.chungying(a)GMAIL.COM> > To: > SAS-L(a)LISTSERV.UGA.EDU > Date: > 02/26/2010 12:14 PM > Subject: > Re: How to specify the ESTIMATE statement in PROC MIXED > Sent by: > "SAS(r) Discussion" <SAS-L(a)LISTSERV.UGA.EDU> > > > > Robin and Dale, > > Thank you for your help and ideas. I have learned a great deal from > your suggestions. > > I'm asked to run these estimates in all kinds of combinations and many > iterations, and wonder if you can suggest some easy way for me to save > the output estimates/standard errors/p-values automatically to files > for reporting (probably via ODS)? > > Susie > > > On Fri, Feb 26, 2010 at 11:55 AM, Robin R High <rhigh(a)unmc.edu> wrote: >> 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 >>> --------------------------------------- >>> >> >> >> >> > > > > |