<?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 How to compare binary IV subgroups on various levels of a multinomial DV in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-compare-binary-IV-subgroups-on-various-levels-of-a/m-p/956710#M47889</link>
    <description>&lt;P&gt;Greetings to everyone reading this post,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Consider a simple univariate analysis where we are looking at two variables: anemia and "treatment".&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Anemia, the DV, consists of four subgroups: Grade 1, Grade 2, Grade 3, and Grade 4.&lt;/LI&gt;&lt;LI&gt;Treatment, IV, consists of two subgroups: Treatment A, Treatment B.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The table I would like to fill looks like such below:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Anemia Grades&lt;/TD&gt;&lt;TD&gt;Total&lt;/TD&gt;&lt;TD&gt;'Treatment A'&lt;/TD&gt;&lt;TD&gt;'Treatment B'&lt;/TD&gt;&lt;TD&gt;p-value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Grade 1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Grade 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Grade 3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Grade 4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I am struggling to determine how I am able to compare the counts between 'Treatment A' and 'Treatment B' for each Grade category to generate a p-value in this simplistic analysis. I do not need specific code (I prefer struggling through it), but some finger-pointing towards the correct way to do this would be SUPER appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Charles Jia&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2025 00:52:09 GMT</pubDate>
    <dc:creator>cjia27</dc:creator>
    <dc:date>2025-01-21T00:52:09Z</dc:date>
    <item>
      <title>How to compare binary IV subgroups on various levels of a multinomial DV</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-compare-binary-IV-subgroups-on-various-levels-of-a/m-p/956710#M47889</link>
      <description>&lt;P&gt;Greetings to everyone reading this post,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Consider a simple univariate analysis where we are looking at two variables: anemia and "treatment".&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Anemia, the DV, consists of four subgroups: Grade 1, Grade 2, Grade 3, and Grade 4.&lt;/LI&gt;&lt;LI&gt;Treatment, IV, consists of two subgroups: Treatment A, Treatment B.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The table I would like to fill looks like such below:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Anemia Grades&lt;/TD&gt;&lt;TD&gt;Total&lt;/TD&gt;&lt;TD&gt;'Treatment A'&lt;/TD&gt;&lt;TD&gt;'Treatment B'&lt;/TD&gt;&lt;TD&gt;p-value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Grade 1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Grade 2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Grade 3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Grade 4&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I am struggling to determine how I am able to compare the counts between 'Treatment A' and 'Treatment B' for each Grade category to generate a p-value in this simplistic analysis. I do not need specific code (I prefer struggling through it), but some finger-pointing towards the correct way to do this would be SUPER appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Charles Jia&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 00:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-compare-binary-IV-subgroups-on-various-levels-of-a/m-p/956710#M47889</guid>
      <dc:creator>cjia27</dc:creator>
      <dc:date>2025-01-21T00:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare binary IV subgroups on various levels of a multinomial DV</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-compare-binary-IV-subgroups-on-various-levels-of-a/m-p/956717#M47890</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;I do not need specific code (I prefer struggling through it), but some finger-pointing towards the correct way to do this would be SUPER appreciated.
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I like your spirit of discovery . If you just want do a univariate BINOMIAL distribution analysis. Could try this one, you need to make a hypothesis H0: p=?&amp;nbsp; fristly.&lt;/P&gt;
&lt;P&gt;The key code of analysis is:&lt;/P&gt;
&lt;PRE&gt;proc freq data=have;
table sex/binomial(&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;level='Female'&lt;/STRONG&gt;&lt;/FONT&gt;);
run;&lt;/PRE&gt;
&lt;P&gt;the output should look like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1737425914884.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103867i59669C2EA27781E3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1737425914884.png" alt="Ksharp_0-1737425914884.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code I suggested, good luck !&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
set sashelp.heart(obs=200);
keep smoking_status sex;
run;
proc sort data=have;by smoking_status;run;
ods select none;
ods output  BinomialTest= BinomialTest;
proc freq data=have;
by smoking_status;
table sex/binomial(level='Female');
run;
proc freq data=have noprint;
table smoking_status*sex/out=freq list;
run;
ods select all;

data BinomialTest2;
 set BinomialTest;
 if Name1='P2_BIN';
 keep smoking_status cValue1;
run;
data report1;
 merge freq BinomialTest2;
 by smoking_status;
run;
proc sql;
create table report2 as
select *,sum(count) as ntotal from report1 group by smoking_status;
quit;

proc report data=report2 nowd;
columns smoking_status ntotal count,sex cValue1;
define smoking_status/group;
define ntotal/group 'Total';
define cValue1/group 'P-Value';
define sex/across 'Treatment';
define count/analysis '';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_1-1737426751700.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103868i8595C0EB7BC5A38D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_1-1737426751700.png" alt="Ksharp_1-1737426751700.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 02:39:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-compare-binary-IV-subgroups-on-various-levels-of-a/m-p/956717#M47890</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-01-21T02:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare binary IV subgroups on various levels of a multinomial DV</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-compare-binary-IV-subgroups-on-various-levels-of-a/m-p/956718#M47891</link>
      <description>&lt;P&gt;To compare levels of your treatment variable, you could use the approach shown in &lt;A href="https://support.sas.com/kb/22/565.html" target="_self"&gt;this note&lt;/A&gt; that uses multiple PROC FREQ steps and then adjusts the p-values for multiplicity. Or you could use the model-based approach with a generalized logit model followed by the NLMeans macro to do the treatment comparisons as illustrated in &lt;A href="https://support.sas.com/kb/57/798.html" target="_self"&gt;this note&lt;/A&gt; - to estimate differences instead of ratios (relative risks), drop options=ratio in the NLMeans macro call.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 02:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-compare-binary-IV-subgroups-on-various-levels-of-a/m-p/956718#M47891</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2025-01-21T02:43:29Z</dc:date>
    </item>
  </channel>
</rss>

