<?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 Re: Macro for proc glimmix and export p-values and OR(95% CI) into Excel file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709470#M218175</link>
    <description>&lt;P&gt;How are you obtaining the OR and 95% CI now? Show the code.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2021 18:30:00 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-01-05T18:30:00Z</dc:date>
    <item>
      <title>Macro for proc glimmix and export p-values and OR(95% CI) into Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709442#M218159</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have approxmiately 60 variables (20 continuous variables and 40 categorical variables) need to be processed by the&amp;nbsp;univariate analysis of general linear mixed model. Below is an example of my code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc glimmix data = All plots =(all) noclprint method=quad;&lt;BR /&gt;class ID Ebus;&lt;BR /&gt;model diagnostic (event=' Yes') = Ebus&lt;BR /&gt;/ solution dist=binary &lt;BR /&gt;oddsratio ;&lt;BR /&gt;random intercept /subject = ID;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could anyone please help me to create a macro code for all the continuous variable and categorical variables and export all the odds ratios (95% condidence intervals) and p-values from the 60 univariate models into an Excel file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 15:46:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709442#M218159</guid>
      <dc:creator>Denali</dc:creator>
      <dc:date>2021-01-05T15:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for proc glimmix and export p-values and OR(95% CI) into Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709449#M218163</link>
      <description>&lt;P&gt;It's not clear whether your 60 variables are all x-variables, or some of them are y-variables, you really need to make it more clear what variables are x and what variables are y.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But your solution is probably this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2017/02/13/run-1000-regressions.html" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/iml/2017/02/13/run-1000-regressions.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 15:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709449#M218163</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-05T15:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for proc glimmix and export p-values and OR(95% CI) into Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709451#M218164</link>
      <description>&lt;P&gt;The 60 variables are predictors (X). Binary outcome (Y) remains the same.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 16:04:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709451#M218164</guid>
      <dc:creator>Denali</dc:creator>
      <dc:date>2021-01-05T16:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for proc glimmix and export p-values and OR(95% CI) into Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709452#M218165</link>
      <description>&lt;P&gt;The BY group method in the link I gave is the way to go. No macros needed.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 16:08:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709452#M218165</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-05T16:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for proc glimmix and export p-values and OR(95% CI) into Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709469#M218174</link>
      <description>&lt;P&gt;I am hoping to export the variable name, OR (95% CI) and p values into an Excel file as below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am still not sure how to do it based on the link you pasted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="666"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="300.667px"&gt;Variables&lt;/TD&gt;
&lt;TD width="300.667px"&gt;OR (95% CI)&lt;/TD&gt;
&lt;TD width="64px"&gt;P-values&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="300.667px"&gt;ALC_Cutoff (High vs Low)&lt;/TD&gt;
&lt;TD width="300.667px"&gt;1.17 (0.35, 3.93)&lt;/TD&gt;
&lt;TD width="64px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="300.667px"&gt;ANC_Cutoff (High vs Low)&lt;/TD&gt;
&lt;TD width="300.667px"&gt;0.00 (0.00, I)&lt;/TD&gt;
&lt;TD width="64px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="300.667px"&gt;Active_Therapy (Yes vs No)&lt;/TD&gt;
&lt;TD width="300.667px"&gt;0.32 (0.09, 1.12)&lt;/TD&gt;
&lt;TD width="64px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="300.667px"&gt;Age_C (Yes vs No)&lt;/TD&gt;
&lt;TD width="300.667px"&gt;0.84 (0.29, 2.49)&lt;/TD&gt;
&lt;TD width="64px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="300.667px"&gt;Blood_Type_A (Yes vs No)&lt;/TD&gt;
&lt;TD width="300.667px"&gt;1.43 (0.47, 4.31)&lt;/TD&gt;
&lt;TD width="64px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="300.667px"&gt;CRP_Cutoff (High vs Low)&lt;/TD&gt;
&lt;TD width="300.667px"&gt;0.29 (0.07, 1.13)&lt;/TD&gt;
&lt;TD width="64px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="300.667px"&gt;Comorbid_CV (Yes vs No)&lt;/TD&gt;
&lt;TD width="300.667px"&gt;1.08 (0.37, 3.18)&lt;/TD&gt;
&lt;TD width="64px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="300.667px"&gt;Comorbid_Immune (Yes vs No)&lt;/TD&gt;
&lt;TD width="300.667px"&gt;0.36 (0.09, 1.43)&lt;/TD&gt;
&lt;TD width="64px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="300.667px"&gt;Comorbid_Pulm (Yes vs No)&lt;/TD&gt;
&lt;TD width="300.667px"&gt;0.17 (0.04, 0.69)&lt;/TD&gt;
&lt;TD width="64px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Tue, 05 Jan 2021 18:11:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709469#M218174</guid>
      <dc:creator>Denali</dc:creator>
      <dc:date>2021-01-05T18:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for proc glimmix and export p-values and OR(95% CI) into Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709470#M218175</link>
      <description>&lt;P&gt;How are you obtaining the OR and 95% CI now? Show the code.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 18:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709470#M218175</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-05T18:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for proc glimmix and export p-values and OR(95% CI) into Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709477#M218180</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the code that I used for exporting the OR (95%CI) from the univariate logistic regression model. I would like to change the code to Glimmix model this time and output the p-values along with the&amp;nbsp;OR (95%CI), but I am not sure how to change the code below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*Categorical Variable*/&lt;BR /&gt;%macro IP(x=,order=);&lt;BR /&gt;ods select cloddswald;&lt;BR /&gt;ods output cloddswald=odds_&amp;amp;order.;&lt;/P&gt;
&lt;P&gt;proc logistic data = CP_new;&lt;BR /&gt;class &amp;amp;x.;&lt;BR /&gt;model improve = &amp;amp;x. /rl;&lt;BR /&gt;run;&lt;BR /&gt;%mend IP;&lt;/P&gt;
&lt;P&gt;%IP(x=Age_C, order=01);&lt;BR /&gt;%IP(x=Gender, order=02);&lt;BR /&gt;%IP(x=Comorbid_CV, order=03);&lt;BR /&gt;%IP(x=Comorbid_Pulm, order=04);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data toprint;&lt;BR /&gt;length effect $ 40;&lt;BR /&gt;set odds_01 - odds_4;&lt;BR /&gt;order = _n_;&lt;BR /&gt;comparison = "(" || strip(substr(effect, anyspace(effect))) || ")";&lt;BR /&gt;name = scan(effect, 1);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc contents data = cp2 out = temp;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sort data = temp;&lt;BR /&gt;by name;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sort data = toprint;&lt;BR /&gt;by name;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data toprint;&lt;BR /&gt;merge toprint(in = in1) temp;&lt;/P&gt;
&lt;P&gt;by name;&lt;/P&gt;
&lt;P&gt;if in1;&lt;/P&gt;
&lt;P&gt;vout = catx(" ", strip(coalescec(label, name)), comparison);&lt;/P&gt;
&lt;P&gt;orout = strip(put(OddsRatioEst, 12.2)) || " (" ||&lt;/P&gt;
&lt;P&gt;strip(put(LowerCL, 12.2)) || ", " ||&lt;/P&gt;
&lt;P&gt;strip(put(UpperCL, 12.2)) || ")";&lt;/P&gt;
&lt;P&gt;label vout = "Variable"&lt;/P&gt;
&lt;P&gt;orout = "Odds Ratio";&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc print data = toprint noobs label;&lt;BR /&gt;var vout orout;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data print;&lt;BR /&gt;set toprint;&lt;BR /&gt;keep vout orout;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc export data=print &lt;BR /&gt;dbms=xlsx outfile="H:\Project\SAS Program\OR_Categorical_12-18-2020.xlsx" &lt;BR /&gt;replace;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently, I am trying to modify the macro to Glimmix as below:&lt;/P&gt;
&lt;P&gt;/*Categorical Variable*/&lt;/P&gt;
&lt;P&gt;%macro IP(x=,order=);&lt;BR /&gt;ods select cloddswald;&lt;BR /&gt;ods output cloddswald=odds_&amp;amp;order.;&lt;/P&gt;
&lt;P&gt;proc glimmix data = All plots =(all) noclprint method=quad;&lt;BR /&gt;class ID &amp;amp;x;&lt;BR /&gt;model robot_diagnostic (event=' Yes') = &amp;amp;x&lt;BR /&gt;/ solution dist=binary &lt;BR /&gt;oddsratio ;&lt;BR /&gt;random intercept /subject = ID;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%mend IP;&lt;/P&gt;
&lt;P&gt;%IP(x=Age_C, order=01);&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 18:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709477#M218180</guid>
      <dc:creator>Denali</dc:creator>
      <dc:date>2021-01-05T18:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for proc glimmix and export p-values and OR(95% CI) into Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709479#M218181</link>
      <description>&lt;P&gt;Well, honestly, I don't see the need for a macro when the link I provided shows how to do it without macros, using a BY statement. You take your (I assume) working PROC LOGISTIC or PROC GLIMMIX code and use it in place of the PROC REG in the link. If you get hung up, be specific, explain where you are having a problem and show your code for the BY statement solution.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 19:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-proc-glimmix-and-export-p-values-and-OR-95-CI-into/m-p/709479#M218181</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-05T19:05:57Z</dc:date>
    </item>
  </channel>
</rss>

