<?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: look at the distribution of a numeric variable and it relationship with categorical variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547362#M151675</link>
    <description>&lt;P&gt;I actually want tables and graph, trying to explore the relationship between charges and ( age,sex,region) and then&amp;nbsp; fit a linear regression for prediction. I have attached the excel file.&lt;/P&gt;</description>
    <pubDate>Sat, 30 Mar 2019 00:43:49 GMT</pubDate>
    <dc:creator>Mariloud</dc:creator>
    <dc:date>2019-03-30T00:43:49Z</dc:date>
    <item>
      <title>look at the distribution of a numeric variable and it relationship with categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547326#M151656</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have variables charges(numeric), age, region( with 4 levels), and sex (female/male). And I want to&amp;nbsp; look at the distribution of charges which is the response variable and it relationship between (age, region, sex).&amp;nbsp; Do I need to create format for&amp;nbsp;(age, region, sex)? what about the charges variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 19:43:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547326#M151656</guid>
      <dc:creator>Mariloud</dc:creator>
      <dc:date>2019-03-29T19:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: look at the distribution of a numeric variable and it relationship with categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547342#M151664</link>
      <description>&lt;P&gt;Do you want tables or graphs? Statistical tests of difference? Something else?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How much information do you want to know about the charges for each level of your categories? Some summary statistics like mean, max, min and standard deviation or do you need quantiles? or counts ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are lots of ways to look at distributions but it helps to give us a starting point what you want. Which would likely depend on what type of question you need to answer with that information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Formats for such things as sex likely would only be affecting appearance of output. A format for age might be used to create a group based on ranges such as 5 or 10 year intervals or other range needed, so that might be appropriate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the assumed somewhat continuous variable charges a format might be useful but without knowing what questions you want to answer saying yay or nay would be a guess without guidance.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 21:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547342#M151664</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-29T21:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: look at the distribution of a numeric variable and it relationship with categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547362#M151675</link>
      <description>&lt;P&gt;I actually want tables and graph, trying to explore the relationship between charges and ( age,sex,region) and then&amp;nbsp; fit a linear regression for prediction. I have attached the excel file.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2019 00:43:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547362#M151675</guid>
      <dc:creator>Mariloud</dc:creator>
      <dc:date>2019-03-30T00:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: look at the distribution of a numeric variable and it relationship with categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547420#M151700</link>
      <description>&lt;P&gt;BOX plot ? Try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc boxplot&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot;&lt;/P&gt;
&lt;P&gt;vbox ......&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2019/03/06/proc-boxplot-hundreds.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2019/03/06/proc-boxplot-hundreds.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Mar 2019 13:48:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547420#M151700</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-03-30T13:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: look at the distribution of a numeric variable and it relationship with categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547645#M151780</link>
      <description>&lt;P&gt;Thank you for responding.&lt;/P&gt;&lt;P&gt;I used proc boxplot and it actually worked, but the output was not quite what I was expected after grouping age into category. Is there a way to have count number together in each age categories&amp;nbsp; instead of categories being&amp;nbsp; spread that way. I have attached the age output below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc format; &lt;BR /&gt;value  agef&lt;BR /&gt; 18-28='&amp;lt;28'&lt;BR /&gt; 29-39='29-39'&lt;BR /&gt; 40-50='40-50'&lt;BR /&gt; 51-61='51-61'&lt;BR /&gt; 61-71='61&amp;gt;';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;*Distribution of charges by age;&lt;BR /&gt;proc sort data= insurance out=insurance_sort;&lt;BR /&gt;by age ;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc boxplot data=insurance_sort;&lt;BR /&gt;plot charges*age;&lt;BR /&gt;format age agef.; &lt;BR /&gt;title 'Distribution of charges by age';&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 15:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547645#M151780</guid>
      <dc:creator>Mariloud</dc:creator>
      <dc:date>2019-04-01T15:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: look at the distribution of a numeric variable and it relationship with categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547649#M151782</link>
      <description>&lt;P&gt;I would try:&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=insurance_sort;
   vbox height /category=age;
   format age agef.;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Apr 2019 16:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547649#M151782</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-01T16:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: look at the distribution of a numeric variable and it relationship with categorical variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547667#M151792</link>
      <description>&lt;P&gt;It worked.Thank you very much.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 17:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/look-at-the-distribution-of-a-numeric-variable-and-it/m-p/547667#M151792</guid>
      <dc:creator>Mariloud</dc:creator>
      <dc:date>2019-04-01T17:22:38Z</dc:date>
    </item>
  </channel>
</rss>

