<?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: GENMOD to test difference between groups? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915881#M45442</link>
    <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;&amp;nbsp;, so in this example, the difference in the number of years worked for teachers with a Bachelors would be on average +9.33 years for males compared to females&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2024 16:48:39 GMT</pubDate>
    <dc:creator>Epi_Stats</dc:creator>
    <dc:date>2024-02-13T16:48:39Z</dc:date>
    <item>
      <title>GENMOD to test difference between groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915862#M45438</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a dataset (sample below) which reports the number of years worked by teachers in the same school.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Among teachers with a Bachelor's degree, I want to look at the independent effect of male teachers on the number of years worked.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The outcome (number of years worked) is continuous, and the independent variables (Bachelor's degree and male sex) are binary (1,2; yes/no).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data results;
input ID bachelors male years_worked;
datalines;
1 0 1 10
2 1 1 17
3 1 0 16
4 0 0 8
5 1 1 27
6 1 0 10
7 0 0 9
8 0 1 4
9 0 1 6
10 1 0 12
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering if it's correct to use PROC GENMOD for this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc genmod data=results;
class bachelors(ref='0');
model years_worked= bachelors male bachelors*male / dist=gamma;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Among teachers with a Bachelor's degree, I want to be able to interpret the effect of male sex on the number of years worked, and state if there is any difference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure if I have the GENMOD statement specified correctly, and how I should interpret this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also how can I see the difference in number of years worked among teachers with a Bachelor's degree who are male vs those who are not male?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd really appreciated any help, thank you&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915862#M45438</guid>
      <dc:creator>Epi_Stats</dc:creator>
      <dc:date>2024-02-13T16:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: GENMOD to test difference between groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915873#M45439</link>
      <description>&lt;P&gt;If your goal as stated means that you want to assess the difference between males and females in the bachelors group, then you can use the LSMEANS statement to do that. In the differences table from the following, the first row makes that comparison.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc genmod data=results;
class bachelors(ref='0') male(ref='0');
model years_worked= bachelors male bachelors*male / dist=gamma link=log;
lsmeans bachelors*male / diff exp cl plots=none;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915873#M45439</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-02-13T16:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: GENMOD to test difference between groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915875#M45440</link>
      <description>&lt;P&gt;Thank you very much&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;&amp;nbsp;for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the output results, how should I interpret the difference in the number of years&amp;nbsp;&lt;SPAN&gt;worked by teachers with a Bachelor's degree who are male vs those who are not male? - In the differences table, the estimate = 0.5521, so do I interpret this as 0.55 more years compared to the same teachers who are not male?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:18:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915875#M45440</guid>
      <dc:creator>Epi_Stats</dc:creator>
      <dc:date>2024-02-13T16:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: GENMOD to test difference between groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915878#M45441</link>
      <description>&lt;P&gt;No, since the model uses the log link, that estimate is the difference in log means, or equivalently the log ratio of means. So the exponentiated estimate, 1.7368, is the estimate of the mean ratio. From the LSMEANS table, you can see that the difference is 22-12.667=9.333. If you want to directly estimate and test the difference in means rather than the log ratio and ratio of means, you can save the model and LSMEANS coefficients table and use the &lt;A href="http://support.sas.com/kb/62362" target="_self"&gt;NLMeans macro&lt;/A&gt;. For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc genmod data=results;
class bachelors(ref='0') male(ref='0');
model years_worked= bachelors male bachelors*male / dist=gamma link=log;
lsmeans bachelors*male / diff exp cl plots=none e;
ods output coef=c;
store gam;
run;
%nlmeans(instore=gam, coef=c, link=log,
     diff=all, title=bach-male diffs)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915878#M45441</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-02-13T16:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: GENMOD to test difference between groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915881#M45442</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;&amp;nbsp;, so in this example, the difference in the number of years worked for teachers with a Bachelors would be on average +9.33 years for males compared to females&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915881#M45442</guid>
      <dc:creator>Epi_Stats</dc:creator>
      <dc:date>2024-02-13T16:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: GENMOD to test difference between groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915882#M45443</link>
      <description>Correct. Since the model is saturated, you'll notice that that is the same as the difference in those means if you compute them using, say, PROC MEANS. But you need GENMOD to get a standard error and confidence limits.</description>
      <pubDate>Tue, 13 Feb 2024 16:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915882#M45443</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-02-13T16:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: GENMOD to test difference between groups?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915883#M45444</link>
      <description>&lt;P&gt;Thanks again, really appreciate your help! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2024 16:55:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/GENMOD-to-test-difference-between-groups/m-p/915883#M45444</guid>
      <dc:creator>Epi_Stats</dc:creator>
      <dc:date>2024-02-13T16:55:16Z</dc:date>
    </item>
  </channel>
</rss>

