From: Arthur Tabachneck on 16 Feb 2010 17:58 Jules, Does adding an ods output statement provide what you want? e.g.,: ods select BasicIntervals; ods output BasicIntervals=BI; proc univariate data=geo cibasic; by mfgr hrs; var conc; output/*out=univ*/; run; HTH, Art --------- On Tue, 16 Feb 2010 17:14:00 -0500, Jules Bosch <jbosch1(a)OPTONLINE.NET> wrote: >I have a SAS data set with two categorical variables and a numeric variable. >The numeric variable is a geometric mean. > > > >What I want to do is add 95% confidence intervals to the data set. > > > >I have tried PROC UNIVARIATE as follows: > > > >ods select BasicIntervals; > >proc univariate data=geo cibasic; > >by mfgr hrs; > >var conc; > >output out=univ; > >run; > > > >but to no avail. > > > >Any help would be appreciated. > > > >Jules
From: Ya Huang on 16 Feb 2010 21:13 Maybe Dale, Robin et al statisticians can chime in. It seems to me that you can't get the CI for geometric mean by simply treat it as a normal distribution. You may need to tranform back using exp()? On Tue, 16 Feb 2010 17:58:49 -0500, Arthur Tabachneck <art297(a)NETSCAPE.NET> wrote: >Jules, > >Does adding an ods output statement provide what you want? e.g.,: > >ods select BasicIntervals; >ods output BasicIntervals=BI; >proc univariate data=geo cibasic; > by mfgr hrs; > var conc; > output/*out=univ*/; >run; > >HTH, >Art >--------- >On Tue, 16 Feb 2010 17:14:00 -0500, Jules Bosch <jbosch1(a)OPTONLINE.NET> >wrote: > >>I have a SAS data set with two categorical variables and a numeric >variable. >>The numeric variable is a geometric mean. >> >> >> >>What I want to do is add 95% confidence intervals to the data set. >> >> >> >>I have tried PROC UNIVARIATE as follows: >> >> >> >>ods select BasicIntervals; >> >>proc univariate data=geo cibasic; >> >>by mfgr hrs; >> >>var conc; >> >>output out=univ; >> >>run; >> >> >> >>but to no avail. >> >> >> >>Any help would be appreciated. >> >> >> >>Jules
From: Arthur Tabachneck on 16 Feb 2010 23:15 Ya, I, too, will leave the evaluation to the statisticians. I was simply offering advice regarding how to obtain the desired intervals. Some interpretation regarding correctness might be found in the following: http://www.jerrydallal.com/LHSP/ci_logs.htm Art --------- On Tue, 16 Feb 2010 21:13:59 -0500, Ya Huang <ya.huang(a)AMYLIN.COM> wrote: >Maybe Dale, Robin et al statisticians can chime in. It seems to me that >you can't get the CI for geometric mean by simply treat it as a normal >distribution. You may need to tranform back using exp()? > >On Tue, 16 Feb 2010 17:58:49 -0500, Arthur Tabachneck <art297(a)NETSCAPE.NET> >wrote: > >>Jules, >> >>Does adding an ods output statement provide what you want? e.g.,: >> >>ods select BasicIntervals; >>ods output BasicIntervals=BI; >>proc univariate data=geo cibasic; >> by mfgr hrs; >> var conc; >> output/*out=univ*/; >>run; >> >>HTH, >>Art >>--------- >>On Tue, 16 Feb 2010 17:14:00 -0500, Jules Bosch <jbosch1(a)OPTONLINE.NET> >>wrote: >> >>>I have a SAS data set with two categorical variables and a numeric >>variable. >>>The numeric variable is a geometric mean. >>> >>> >>> >>>What I want to do is add 95% confidence intervals to the data set. >>> >>> >>> >>>I have tried PROC UNIVARIATE as follows: >>> >>> >>> >>>ods select BasicIntervals; >>> >>>proc univariate data=geo cibasic; >>> >>>by mfgr hrs; >>> >>>var conc; >>> >>>output out=univ; >>> >>>run; >>> >>> >>> >>>but to no avail. >>> >>> >>> >>>Any help would be appreciated. >>> >>> >>> >>>Jules
From: Robin R High on 17 Feb 2010 11:12 Jules, It's not totally clear what your input data look like, but assuming they are already on a log scale and you have at least 2 observations for each level of mfgr and hrs, you could run: ods select BasicIntervals; proc univariate data=geo cibasic; BY mfgr hrs; VAR conc; output out=univ mean=lg_cn std=std stdmean= stdmn n=n; run; DATA univ; SET univ; lowerCL = lg_cn + TINV(.025,n-1)*stdmn; * lower and upper cl's don't appear to be an option with output statement; upperCL = lg_cn + TINV(.975,n-1)*stdmn; RUN; proc print data=univ; run; You could also save the basicintervals contents into an ODS dataset as well, though have the other two rows per grouping classification to deal with. With the un-logged (actual) data, you can coax the geometric mean and 95% conf interval directly from GLIMMIX. First, add a constant value to the data set, intcpt='1' and then run: ods output parameterestimates=prms; ods listing close; proc glimmix data=geo; by mfgr hrs; CLASS intcpt; model conc_actual = intcpt / NOint dist=lognormal solution cl; run; ods listing; proc print data=prms NOObs; run; Robin High UNMC From: Jules Bosch <jbosch1(a)OPTONLINE.NET> To: SAS-L(a)LISTSERV.UGA.EDU Date: 02/16/2010 04:16 PM Subject: CIBASIC Sent by: "SAS(r) Discussion" <SAS-L(a)LISTSERV.UGA.EDU> I have a SAS data set with two categorical variables and a numeric variable. The numeric variable is a geometric mean. What I want to do is add 95% confidence intervals to the data set. I have tried PROC UNIVARIATE as follows: ods select BasicIntervals; proc univariate data=geo cibasic; by mfgr hrs; var conc; output out=univ; run; but to no avail. Any help would be appreciated. Jules
|
Pages: 1 Prev: Unbalanced panel regression Next: SAS v9.2.2 feature: ODS statement required |