<?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 comparison of 2 groups (or 2 time periods) in multivariable logistic regression in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/comparison-of-2-groups-or-2-time-periods-in-multivariable/m-p/730430#M35421</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have generated the following macro for differences of differences (2 procedures, 2 time periods) in a multivariable logistic regression model to compare 2 procedures' changes between 2 time periods. First of all, are my -1 and 1 coefficients in the lsmestimate statement correct?&amp;nbsp; Secondly, how do I take a step back to compare just the 2 time periods (regardless of procedure) and get p values and odds ratios for the comparison? I thought this would be the easier part.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;* Perform multivariate regression on predictors of readmission, reoperation, and morbidity for differences of differences in Tables 3-5;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%macro logodds(var);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc logistic data=data09_19;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;class time proc race_o smoking hypertension dial ASA_ge3 plf_adj rev_surg / param=glm ref=first;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;model &amp;amp;var(event="1") = time proc time*proc age1 race_o smoking hypertension dial ASA_ge3 tothlos plf_adj rev_surg;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lsmeans time*proc / e ilink adjust=bon;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lsmestimate time*proc "Diff in Diff LogOdds" 1 -1 -1 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ods output modelanova=anova oddsratios=odds;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;store log;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc print data=anova;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc print data=odds;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc export data=anova&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&amp;amp;var._anova.xls"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dbms=xls replace;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc export data=odds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&amp;amp;var._odds.xls"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dbms=xls replace;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%mend logodds;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%logodds(readm_c);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%logodds(reop_c);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%logodds(morbidity_c);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Mar 2021 17:05:15 GMT</pubDate>
    <dc:creator>msarin</dc:creator>
    <dc:date>2021-03-31T17:05:15Z</dc:date>
    <item>
      <title>comparison of 2 groups (or 2 time periods) in multivariable logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/comparison-of-2-groups-or-2-time-periods-in-multivariable/m-p/730430#M35421</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have generated the following macro for differences of differences (2 procedures, 2 time periods) in a multivariable logistic regression model to compare 2 procedures' changes between 2 time periods. First of all, are my -1 and 1 coefficients in the lsmestimate statement correct?&amp;nbsp; Secondly, how do I take a step back to compare just the 2 time periods (regardless of procedure) and get p values and odds ratios for the comparison? I thought this would be the easier part.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;* Perform multivariate regression on predictors of readmission, reoperation, and morbidity for differences of differences in Tables 3-5;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%macro logodds(var);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc logistic data=data09_19;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;class time proc race_o smoking hypertension dial ASA_ge3 plf_adj rev_surg / param=glm ref=first;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;model &amp;amp;var(event="1") = time proc time*proc age1 race_o smoking hypertension dial ASA_ge3 tothlos plf_adj rev_surg;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lsmeans time*proc / e ilink adjust=bon;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lsmestimate time*proc "Diff in Diff LogOdds" 1 -1 -1 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ods output modelanova=anova oddsratios=odds;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;store log;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc print data=anova;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc print data=odds;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc export data=anova&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&amp;amp;var._anova.xls"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dbms=xls replace;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc export data=odds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&amp;amp;var._odds.xls"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dbms=xls replace;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%mend logodds;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%logodds(readm_c);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%logodds(reop_c);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%logodds(morbidity_c);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 17:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/comparison-of-2-groups-or-2-time-periods-in-multivariable/m-p/730430#M35421</guid>
      <dc:creator>msarin</dc:creator>
      <dc:date>2021-03-31T17:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: comparison of 2 groups (or 2 time periods) in multivariable logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/comparison-of-2-groups-or-2-time-periods-in-multivariable/m-p/730516#M35427</link>
      <description>&lt;P&gt;I ended up cleaning up the redundancy in the above macro and coming up with the second one below in answer to my own question. &amp;nbsp;Does anybody have any comments?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* Perform multivariate regression on predictors of readmission, reoperation, and morbidity for differences of differences in Tables 3-5;&lt;/P&gt;&lt;P&gt;%macro logodds(var);&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc logistic data=data09_19;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; class time proc race_o smoking hypertension dial ASA_ge3 plf_adj rev_surg / param=glm ref=first;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; model &amp;amp;var(event="1") = time proc time*proc age1 race_o smoking hypertension dial ASA_ge3 tothlos plf_adj rev_surg;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; lsmeans time*proc / e ilink diff oddsratio cl adjust=bon;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ods output modelanova=anova oddsratios=odds;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; store log;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc print data=anova;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc print data=odds;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc export data=anova&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&amp;amp;var._anova.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc export data=odds&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&amp;amp;var._odds.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;%mend logodds;&lt;/P&gt;&lt;P&gt;%logodds(readm_c);&lt;/P&gt;&lt;P&gt;%logodds(reop_c);&lt;/P&gt;&lt;P&gt;%logodds(morbidity_c);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* Perform multivariate regression on predictors of readmission, reoperation, and morbidity to compare time periods within each surgical approach in Tables 3-5;&lt;/P&gt;&lt;P&gt;%macro logodds_times(var,prc);&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc logistic data=data09_19;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;class time proc race_o smoking hypertension dial ASA_ge3 plf_adj rev_surg / param=glm ref=first;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; model &amp;amp;var(event="1") = time proc time*proc age1 race_o smoking hypertension dial ASA_ge3 tothlos plf_adj rev_surg;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; where proc=&amp;amp;prc;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; lsmeans time*proc / e ilink diff oddsratio cl adjust=bon;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ods output modelanova=anova oddsratios=odds;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; store log;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc print data=anova;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc print data=odds;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc export data=anova&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&amp;amp;var&amp;amp;prc._anova_times.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc export data=odds&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&amp;amp;var&amp;amp;prc._odds_times.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; dbms=xls replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;%mend logodds_times;&lt;/P&gt;&lt;P&gt;%logodds_times(readm_c,1);&lt;/P&gt;&lt;P&gt;%logodds_times(readm_c,2);&lt;/P&gt;&lt;P&gt;%logodds_times(reop_c,1);&lt;/P&gt;&lt;P&gt;%logodds_times(reop_c,2);&lt;/P&gt;&lt;P&gt;%logodds_times(morbidity_c,1);&lt;/P&gt;&lt;P&gt;%logodds_times(morbidity_c,2);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 20:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/comparison-of-2-groups-or-2-time-periods-in-multivariable/m-p/730516#M35427</guid>
      <dc:creator>msarin</dc:creator>
      <dc:date>2021-03-31T20:59:38Z</dc:date>
    </item>
  </channel>
</rss>

