<?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 Using Proc GLM with Categorical Variables/How to get Post Hoc results in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Using-Proc-GLM-with-Categorical-Variables-How-to-get-Post-Hoc/m-p/465216#M24202</link>
    <description>&lt;P&gt;Hi everyone. I am new-ish to using SAS and am hoping for some help on if my code is correct for what I am after. I have the following variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Medications: the total number of medications taken per person&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sex&amp;nbsp;&lt;BR /&gt;1=male&lt;/P&gt;&lt;P&gt;2=female&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AgeGroups&lt;/P&gt;&lt;P&gt;1=20-25&lt;/P&gt;&lt;P&gt;2=26-29&lt;/P&gt;&lt;P&gt;3=30-34&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interaction between Sex and AgeGroups:&lt;/P&gt;&lt;P&gt;AgeGroups*Sex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Income&lt;/P&gt;&lt;P&gt;1=Less than 20k&lt;/P&gt;&lt;P&gt;2=20,000 – 49,999&lt;/P&gt;&lt;P&gt;3=50,000 – 79,999&lt;/P&gt;&lt;P&gt;4=80,000 – 99,999&lt;/P&gt;&lt;P&gt;5=100,000 or more&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find out if any of the categorical demographic variables have a significant effect on the number of medications. Then I want to find out where the significant differences&amp;nbsp;are between groups. I am using linear regression. After some Google searching, I have come up with the following code. Is it correct to get what I am looking for? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc glm data=mydata;&lt;BR /&gt;class Sex AgeGroups Income;&lt;BR /&gt;model Medications=Sex AgeGroups&amp;nbsp;Income AgeGroups*Sex /solution;&lt;BR /&gt;lsmeans&amp;nbsp;Sex AgeGroups&amp;nbsp;Income AgeGroups*Sex /adjust=scheffe;&lt;BR /&gt;run; quit;&lt;/P&gt;</description>
    <pubDate>Fri, 25 May 2018 20:24:01 GMT</pubDate>
    <dc:creator>someone456</dc:creator>
    <dc:date>2018-05-25T20:24:01Z</dc:date>
    <item>
      <title>Using Proc GLM with Categorical Variables/How to get Post Hoc results</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-Proc-GLM-with-Categorical-Variables-How-to-get-Post-Hoc/m-p/465216#M24202</link>
      <description>&lt;P&gt;Hi everyone. I am new-ish to using SAS and am hoping for some help on if my code is correct for what I am after. I have the following variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Medications: the total number of medications taken per person&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sex&amp;nbsp;&lt;BR /&gt;1=male&lt;/P&gt;&lt;P&gt;2=female&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AgeGroups&lt;/P&gt;&lt;P&gt;1=20-25&lt;/P&gt;&lt;P&gt;2=26-29&lt;/P&gt;&lt;P&gt;3=30-34&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interaction between Sex and AgeGroups:&lt;/P&gt;&lt;P&gt;AgeGroups*Sex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Income&lt;/P&gt;&lt;P&gt;1=Less than 20k&lt;/P&gt;&lt;P&gt;2=20,000 – 49,999&lt;/P&gt;&lt;P&gt;3=50,000 – 79,999&lt;/P&gt;&lt;P&gt;4=80,000 – 99,999&lt;/P&gt;&lt;P&gt;5=100,000 or more&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find out if any of the categorical demographic variables have a significant effect on the number of medications. Then I want to find out where the significant differences&amp;nbsp;are between groups. I am using linear regression. After some Google searching, I have come up with the following code. Is it correct to get what I am looking for? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc glm data=mydata;&lt;BR /&gt;class Sex AgeGroups Income;&lt;BR /&gt;model Medications=Sex AgeGroups&amp;nbsp;Income AgeGroups*Sex /solution;&lt;BR /&gt;lsmeans&amp;nbsp;Sex AgeGroups&amp;nbsp;Income AgeGroups*Sex /adjust=scheffe;&lt;BR /&gt;run; quit;&lt;/P&gt;</description>
      <pubDate>Fri, 25 May 2018 20:24:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-Proc-GLM-with-Categorical-Variables-How-to-get-Post-Hoc/m-p/465216#M24202</guid>
      <dc:creator>someone456</dc:creator>
      <dc:date>2018-05-25T20:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using Proc GLM with Categorical Variables/How to get Post Hoc results</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-Proc-GLM-with-Categorical-Variables-How-to-get-Post-Hoc/m-p/465248#M24203</link>
      <description>&lt;P&gt;What about the other interactions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;model Medications=Sex|AgeGroups|Income;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 May 2018 04:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-Proc-GLM-with-Categorical-Variables-How-to-get-Post-Hoc/m-p/465248#M24203</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-05-26T04:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using Proc GLM with Categorical Variables/How to get Post Hoc results</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-Proc-GLM-with-Categorical-Variables-How-to-get-Post-Hoc/m-p/465265#M24207</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212080"&gt;@someone456&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone. I am new-ish to using SAS and am hoping for some help on if my code is correct for what I am after. I have the following variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Medications: the total number of medications taken per person&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sex&amp;nbsp;&lt;BR /&gt;1=male&lt;/P&gt;
&lt;P&gt;2=female&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AgeGroups&lt;/P&gt;
&lt;P&gt;1=20-25&lt;/P&gt;
&lt;P&gt;2=26-29&lt;/P&gt;
&lt;P&gt;3=30-34&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interaction between Sex and AgeGroups:&lt;/P&gt;
&lt;P&gt;AgeGroups*Sex&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Income&lt;/P&gt;
&lt;P&gt;1=Less than 20k&lt;/P&gt;
&lt;P&gt;2=20,000 – 49,999&lt;/P&gt;
&lt;P&gt;3=50,000 – 79,999&lt;/P&gt;
&lt;P&gt;4=80,000 – 99,999&lt;/P&gt;
&lt;P&gt;5=100,000 or more&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to find out if any of the categorical demographic variables have a significant effect on the number of medications. Then I want to find out where the significant differences&amp;nbsp;are between groups. I am using linear regression. After some Google searching, I have come up with the following code. Is it correct to get what I am looking for? Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc glm data=mydata;&lt;BR /&gt;class Sex AgeGroups Income;&lt;BR /&gt;model Medications=Sex AgeGroups&amp;nbsp;Income AgeGroups*Sex /solution;&lt;BR /&gt;lsmeans&amp;nbsp;Sex AgeGroups&amp;nbsp;Income AgeGroups*Sex /adjust=scheffe;&lt;BR /&gt;run; quit;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your question about differences between groups is answered by the LSMEANS statement. So I think this is the correct code.&lt;/P&gt;</description>
      <pubDate>Sat, 26 May 2018 11:34:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-Proc-GLM-with-Categorical-Variables-How-to-get-Post-Hoc/m-p/465265#M24207</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-05-26T11:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using Proc GLM with Categorical Variables/How to get Post Hoc results</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Using-Proc-GLM-with-Categorical-Variables-How-to-get-Post-Hoc/m-p/465303#M24218</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;that you are on the right track.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;that you need to&amp;nbsp;consider whether to exclude&amp;nbsp;other potential interactions among the fixed effects (and be able to justify their exclusion).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition, I would think of this as an ANOVA rather than a regression. Of course ANOVA is really just a special case of regression, but there are things we&amp;nbsp;can apply in ANOVA models that we don't&amp;nbsp;apply in regression (like LSMEANS as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;suggested). ANOVA models have assumptions (notably, normality and homogeneity of variance and independence) that you would need to assess&amp;nbsp;for your analysis.&amp;nbsp;&lt;A href="https://www.sas.com/store/books/categories/usage-and-reference/sas-for-linear-models-fourth-edition/prodBK_56655_en.html" target="_self"&gt;SAS® for Linear Models, Fourth Edition&lt;/A&gt;&amp;nbsp;is an excellent resource; these are topics that are also covered extensively in courses, and so there are resources available on the internet, in books, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 May 2018 03:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Using-Proc-GLM-with-Categorical-Variables-How-to-get-Post-Hoc/m-p/465303#M24218</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2018-05-27T03:28:27Z</dc:date>
    </item>
  </channel>
</rss>

