<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Outputting Odds Ratios and Confidence Intervals into Excel file in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-Odds-Ratios-and-Confidence-Intervals-into-Excel-file/m-p/837489#M25965</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;I am looking at several medical history factors in relation to resistance to beta amyloid. I would like to output all the odds ratios along with wald confidence intervals into the same excel file so that I can make one odds ratio plot with all medical history variables. Additionally, is it possible to output an odds ratio graph from SAS that includes all the medical history variables? Thank you in advance for your help, and please let me if you would like me to clarify anything. I have attached below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro log (pred=);
proc logistic data=za.res plots(only)=oddsratio(logbase=2 range=(0.1,20)) ;
   class &amp;amp;pred (ref='0') uci_gender (ref='1') UCI_education( ref='0')/param=ref ;
   model resistance (event='0') = &amp;amp;pred UCI_agedeath uci_gender UCI_education/ link=logit  ;
   oddsratio &amp;amp;pred;
ods output OddsRatiosWald=orplots;
run;
%mend log;


%log(pred= HBP); *N=423, not significant 0.30;
%log(pred=stroke); *N=419, p=0.86;
%log(pred=cholest); *N=412, p=0.20;
%log(pred=diabete); *N=425, p= 0.87;
%log(pred=htloc); *N=421,p=0.92;
%log(pred=Glaucom); *N=419, p=0.60;
%log (pred=colon); *N=423,p=0.23;
%log(pred=syncope); *N=422,p=0.92;
%log(pred=thyroid); *N=420, p=0.54;
%log(pred= cataract); *N=422, p=0.04;
%log(pred= seizures); *N=423, p=0.07;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the code of the logistic regressions from which I am getting the odds ratios.&lt;/P&gt;</description>
    <pubDate>Sat, 08 Oct 2022 01:14:22 GMT</pubDate>
    <dc:creator>zaldarsa</dc:creator>
    <dc:date>2022-10-08T01:14:22Z</dc:date>
    <item>
      <title>Outputting Odds Ratios and Confidence Intervals into Excel file</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-Odds-Ratios-and-Confidence-Intervals-into-Excel-file/m-p/837489#M25965</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;I am looking at several medical history factors in relation to resistance to beta amyloid. I would like to output all the odds ratios along with wald confidence intervals into the same excel file so that I can make one odds ratio plot with all medical history variables. Additionally, is it possible to output an odds ratio graph from SAS that includes all the medical history variables? Thank you in advance for your help, and please let me if you would like me to clarify anything. I have attached below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro log (pred=);
proc logistic data=za.res plots(only)=oddsratio(logbase=2 range=(0.1,20)) ;
   class &amp;amp;pred (ref='0') uci_gender (ref='1') UCI_education( ref='0')/param=ref ;
   model resistance (event='0') = &amp;amp;pred UCI_agedeath uci_gender UCI_education/ link=logit  ;
   oddsratio &amp;amp;pred;
ods output OddsRatiosWald=orplots;
run;
%mend log;


%log(pred= HBP); *N=423, not significant 0.30;
%log(pred=stroke); *N=419, p=0.86;
%log(pred=cholest); *N=412, p=0.20;
%log(pred=diabete); *N=425, p= 0.87;
%log(pred=htloc); *N=421,p=0.92;
%log(pred=Glaucom); *N=419, p=0.60;
%log (pred=colon); *N=423,p=0.23;
%log(pred=syncope); *N=422,p=0.92;
%log(pred=thyroid); *N=420, p=0.54;
%log(pred= cataract); *N=422, p=0.04;
%log(pred= seizures); *N=423, p=0.07;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the code of the logistic regressions from which I am getting the odds ratios.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2022 01:14:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-Odds-Ratios-and-Confidence-Intervals-into-Excel-file/m-p/837489#M25965</guid>
      <dc:creator>zaldarsa</dc:creator>
      <dc:date>2022-10-08T01:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Outputting Odds Ratios and Confidence Intervals into Excel file</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-Odds-Ratios-and-Confidence-Intervals-into-Excel-file/m-p/837501#M25966</link>
      <description>&lt;P&gt;If you change your code on this line so that you create different data sets then you would have all them available to plot, print ore what have. As it is you overwrite the file and only have the one from the last run.&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;ods output OddsRatiosWald=orplots;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;You could get a different name by using something like below by adding the name of the variable to the set.&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;ods output OddsRatiosWald=orplots&amp;amp;pred.;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not quite sure exactly what you may want for a "all variables" plot, but I suspect that it would involve combining the above data sets into a single one. There may be some fiddly bits involved stacking these sets as the Effect variable may have different lengths.&lt;/P&gt;
&lt;P&gt;The Odds ratio plot is basically a Highlow plot for the confidence limits&amp;nbsp; with a scatter plot of the OR value overlaid.&lt;/P&gt;
&lt;P&gt;I'm not sure exactly what you want the "all variables" plot to look like though that should get you started on that part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can place all of the output into a single xlsx with ods by placing all of the output you want between the ODS EXCEL and close statements&lt;/P&gt;
&lt;PRE&gt;ods excel file="&amp;lt;path to file location&amp;gt;\filename.xlsx";

&amp;lt;all you code producing output you want in the file 
goes here&amp;gt;

ods excel close;&lt;/PRE&gt;
&lt;P&gt;Likely you would want to provide some options for controlling sheets the output goes to but that is a separate topic.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2022 05:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Outputting-Odds-Ratios-and-Confidence-Intervals-into-Excel-file/m-p/837501#M25966</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-08T05:15:15Z</dc:date>
    </item>
  </channel>
</rss>

