- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
How do i output the binomial test into a dataset?
Thank you!
%macro yesci (var= ,trt=, p= , out=);
proc freq data=mrg2;
where trt01pn in (&trt);
tables &var / binomial(p=&p level="Y") out=&out;
run;
%mend yesci;
%yesci (var=cat6, trt=2 , p=0.242, out=cat6_trt2 );
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The generic skill is to use the ODS Trace option:
<dummy code>
ods trace on; proc whatever <options>; run; ods trace off;
Your log will show the names of the output objects.
Example you can run:
ods trace on; proc freq data=sashelp.class; tables sex / binomial; run; ods trace off;
The log shows:
Output Added: ------------- Name: OneWayFreqs Label: One-Way Frequencies Template: Base.Freq.OneWayFreqs Path: Freq.Table1.OneWayFreqs ------------- Output Added: ------------- Name: Binomial Label: Binomial Proportion Template: Base.Freq.BinomialStatFactoid Path: Freq.Table1.Binomial ------------- Output Added: ------------- Name: BinomialTest Label: Binomial Proportion Test Template: Base.Freq.BinomialStatFactoid Path: Freq.Table1.BinomialTest -------------
You would use the bit(s) with the Name: in and ODS OUTPUT statement with <name>=<your data set name> pairs for the desired objects:
ods output BinomialTest= mybinomialtestdataset; proc freq data=sashelp.class; tables sex / binomial; run;
OR read the online help for the procedure. The Details section should have an ODS TABLE NAMES section that will have the name of the table (i.e. BinomialTest) and the option(s) required to create it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The generic skill is to use the ODS Trace option:
<dummy code>
ods trace on; proc whatever <options>; run; ods trace off;
Your log will show the names of the output objects.
Example you can run:
ods trace on; proc freq data=sashelp.class; tables sex / binomial; run; ods trace off;
The log shows:
Output Added: ------------- Name: OneWayFreqs Label: One-Way Frequencies Template: Base.Freq.OneWayFreqs Path: Freq.Table1.OneWayFreqs ------------- Output Added: ------------- Name: Binomial Label: Binomial Proportion Template: Base.Freq.BinomialStatFactoid Path: Freq.Table1.Binomial ------------- Output Added: ------------- Name: BinomialTest Label: Binomial Proportion Test Template: Base.Freq.BinomialStatFactoid Path: Freq.Table1.BinomialTest -------------
You would use the bit(s) with the Name: in and ODS OUTPUT statement with <name>=<your data set name> pairs for the desired objects:
ods output BinomialTest= mybinomialtestdataset; proc freq data=sashelp.class; tables sex / binomial; run;
OR read the online help for the procedure. The Details section should have an ODS TABLE NAMES section that will have the name of the table (i.e. BinomialTest) and the option(s) required to create it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
where trt01pn in (&trt);
tables &var / binomial(p=&p level="Y") ;
output out=&out binomial ;
run;