<?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: Sgplot - regression slope by group in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531948#M26816</link>
    <description>&lt;P&gt;I was asking you to run the code I provided exactly as it is. The data set Sashelp.Cars is included with SAS. It contains the three variables that I reference:&lt;/P&gt;
&lt;P&gt;Origin : the grouping variable with values 'Asia', 'Europe', and 'USA'&lt;/P&gt;
&lt;P&gt;Weight: The X or explanatory variable (the weight of vehicles, in pounds)&lt;/P&gt;
&lt;P&gt;MPG_City : The Y or response variable (the fuel efficiency, in miles per gallon)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After you verify that you run my code without error, we can discuss how to adapt it to your data.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2019 12:32:10 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2019-02-01T12:32:10Z</dc:date>
    <item>
      <title>Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531896#M26808</link>
      <description>&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the below sample data&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input grade bmi;
cards;
0 25.58
2 26.24
3 38.4
1 22.8
2 32.31
0 .
1 55.20
;
run;

proc sgplot data=have;
   reg x=grade y=bmi / clm nomarkers; 
run;&lt;BR /&gt;&lt;BR /&gt;OR&lt;BR /&gt;&lt;BR /&gt;proc sgplot data=have;
   reg x=grade y=bmi / group =grade clm nomarkers; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="reg1.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26752i73B01807A37762BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="reg1.png" alt="reg1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;While run my code, it printed an Output as above image.&lt;/P&gt;&lt;P&gt;&amp;nbsp;But i want my output as below mentioned image.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="reg2.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26753iD9EB0ECDB2330A11/image-size/large?v=v2&amp;amp;px=999" role="button" title="reg2.png" alt="reg2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with different options but it results partial output.&lt;/P&gt;&lt;P&gt;Please help me to get the above output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 06:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531896#M26808</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2019-02-01T06:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531910#M26809</link>
      <description>&lt;P&gt;I run this code:&lt;/P&gt;
&lt;PRE&gt;data have;
input grade bmi;
cards;
0 25.58
2 26.24
3 38.4
1 22.8
2 32.31
0 .
1 55.20
;
run;

proc sgplot data=have;
   reg x=grade y=bmi / group =grade clm nomarkers; 
run;&lt;/PRE&gt;
&lt;P&gt;And I get an error:&lt;/P&gt;
&lt;PRE&gt;NOTE: There are insufficient usable observations for REGRESSION fitting for group '0'.
ERROR: No REGRESSION fit done for group '1' as the regressor is constant.
ERROR: No REGRESSION fit done for group '2' as the regressor is constant.
NOTE: There are insufficient usable observations for REGRESSION fitting for group '3'.
&lt;/PRE&gt;
&lt;P&gt;Hence not enough data for an actual output, however the graph itself does show grouping is working correctly, with the groups shown?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 08:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531910#M26809</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-01T08:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531914#M26810</link>
      <description>&lt;P&gt;Sorry for the inconvenience,&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually its a sample data. I just use this sample to showcase my issue to get some idea/sample code.&lt;/P&gt;&lt;P&gt;If you required a perfect data, please have a look on the attach (orginal dataset) here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And its all yours.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 08:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531914#M26810</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2019-02-01T08:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531915#M26811</link>
      <description>&lt;P&gt;I have moved you to the stats procedures section.&amp;nbsp; As stated above the graph produces correctly with the groupings.&amp;nbsp; I cannot however get the reg to and am not a statistician to be able to tell you from your data what is not working.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 09:06:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531915#M26811</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-01T09:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531926#M26812</link>
      <description>&lt;P&gt;That's fine.&lt;/P&gt;&lt;P&gt;Thank you for your valuable time to spend it on my issue.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 10:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531926#M26812</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2019-02-01T10:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531938#M26814</link>
      <description>&lt;P&gt;Maybe I am misunderstanding, but your PROC SGPLOT code should give you the output that I think you want. Try the following example, which we can all run.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.cars;
reg x=weight y=mpg_city / group=Origin clm nomarkers;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Do you see the output you want?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 11:14:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531938#M26814</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-02-01T11:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531945#M26815</link>
      <description>&lt;P&gt;Thank you for ur suggestion&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The weight key word was not respond (Is it a keyword / variable ?)&lt;/P&gt;&lt;P&gt;It results :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=reg2;
reg x=weight y=fvbmi / group=fvGrade clm nomarkers;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;proc sgplot data=reg2;&lt;BR /&gt;reg x=weight y=fvbmi / group=fvGrade clm nomarkers;&lt;BR /&gt;ERROR: Variable WEIGHT not found.&lt;BR /&gt;266 run;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the Yaxis = fvbmi&lt;/P&gt;&lt;P&gt;for the Group = fvGrade&lt;/P&gt;&lt;P&gt;Xaxis = ? - I don't know how to correlate it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:22:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531945#M26815</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2019-02-01T12:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531948#M26816</link>
      <description>&lt;P&gt;I was asking you to run the code I provided exactly as it is. The data set Sashelp.Cars is included with SAS. It contains the three variables that I reference:&lt;/P&gt;
&lt;P&gt;Origin : the grouping variable with values 'Asia', 'Europe', and 'USA'&lt;/P&gt;
&lt;P&gt;Weight: The X or explanatory variable (the weight of vehicles, in pounds)&lt;/P&gt;
&lt;P&gt;MPG_City : The Y or response variable (the fuel efficiency, in miles per gallon)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After you verify that you run my code without error, we can discuss how to adapt it to your data.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:32:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531948#M26816</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-02-01T12:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531952#M26817</link>
      <description>&lt;P&gt;Sorry I misunderstood. (I thought it was a keyword because of the blue font)&lt;/P&gt;&lt;P&gt;Yes this is exactly what I'm looking for.&lt;/P&gt;&lt;P&gt;I want this method to adapt with my data,&amp;nbsp;&lt;/P&gt;&lt;P&gt;My diagram should have to represent with BMI and Grade&lt;/P&gt;&lt;P&gt;In my data I have ID, Bmi, Grade and some other on... in your method 3 variables are used.&lt;/P&gt;&lt;P&gt;There were I stucked.&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;</description>
      <pubDate>Fri, 01 Feb 2019 12:43:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531952#M26817</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2019-02-01T12:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531956#M26818</link>
      <description>&lt;P&gt;&lt;SPAN&gt;What model are you trying to visualize? You want the Y variable to be the response (bmi), the X variable to be a continuous covariate in the model, and the GROUP= variable to be a classification effect (Grade?).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You've only posted 2 variables, so I don't know what to suggest. You say you have "&lt;SPAN&gt;ID... and some other ones", so maybe post the first 100-200 observations of your complete data.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:00:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/531956#M26818</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-02-01T13:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/532045#M26823</link>
      <description>&lt;P&gt;I have to say that a plot, or a regression done in&amp;nbsp;a similar way to&lt;/P&gt;
&lt;PRE&gt;Proc sgplot data=have;
   reg x=grade y=bmi / group =grade clm nomarkers; 
run;&lt;/PRE&gt;
&lt;P&gt;Makes absolutely no sense. You are asking for a single plot for each X value. That means all of the points in a regression have the exact same grade.&lt;/P&gt;
&lt;P&gt;Run this code and examine what the scatter points look like:&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=sashelp.class;

   scatter x=age y=height/group=age;
run;&lt;/PRE&gt;
&lt;P&gt;There are 6 groups of ages with a vertical plot of the height at each age. The "slope" of the regression line is infinite (vertical). Which is why running a similar regression instead of scatter in the above plot yields a bunch of statements for each group of&lt;/P&gt;
&lt;PRE&gt;ERROR: No REGRESSION fit done for group '11' as the regressor is constant.
&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 15:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/532045#M26823</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-01T15:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/532492#M26841</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below excel file have the complete dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I just want to visualize, How the each grade has been varies in BMI (fvBmi) value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 03:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/532492#M26841</guid>
      <dc:creator>Sathish_jammy</dc:creator>
      <dc:date>2019-02-04T03:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sgplot - regression slope by group</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/532529#M26843</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp; I just want to visualize, How the each grade has been varies in BMI (fvBmi) value.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;GRADE seems to be a discrete variable, so I'd &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2016/12/08/getting-started-sgplot-part-3-vbox/" target="_self"&gt;use a box plot to visualize the distribution&lt;/A&gt; of fvBMI for each grade:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=Have;
   vbox fvbmi / category=fvGrade;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 10:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Sgplot-regression-slope-by-group/m-p/532529#M26843</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-02-04T10:42:38Z</dc:date>
    </item>
  </channel>
</rss>

