<?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 Fitting a model within a linear regression in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fitting-a-model-within-a-linear-regression/m-p/531249#M145380</link>
    <description>&lt;P&gt;How do I fit a model that allows for different slopes and intercepts for the two brands (A and B) and then find a final model (a regression line) for the data below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data model;
	input make $ speed cost @@;
	datalines;
	A 10 9.8 A 20 12.5 A 20 14.2 A 30 14.9 
	A 40 19.0 A 40 16.5 A 50 20.9 A 60 22.4
	A 60 24.1 A 70 25.8 B 10 15.0 B 20 14.5
	B 20 16.1 B 30 16.5 B 40 16.4 B 40 19.1
	B 50 20.9 B 60 22.3 B 60 19.8 B 70 21.4
;
run;

proc print data=model;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Jan 2019 03:58:11 GMT</pubDate>
    <dc:creator>JUMMY</dc:creator>
    <dc:date>2019-01-30T03:58:11Z</dc:date>
    <item>
      <title>Fitting a model within a linear regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-a-model-within-a-linear-regression/m-p/531249#M145380</link>
      <description>&lt;P&gt;How do I fit a model that allows for different slopes and intercepts for the two brands (A and B) and then find a final model (a regression line) for the data below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data model;
	input make $ speed cost @@;
	datalines;
	A 10 9.8 A 20 12.5 A 20 14.2 A 30 14.9 
	A 40 19.0 A 40 16.5 A 50 20.9 A 60 22.4
	A 60 24.1 A 70 25.8 B 10 15.0 B 20 14.5
	B 20 16.1 B 30 16.5 B 40 16.4 B 40 19.1
	B 50 20.9 B 60 22.3 B 60 19.8 B 70 21.4
;
run;

proc print data=model;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Jan 2019 03:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-a-model-within-a-linear-regression/m-p/531249#M145380</guid>
      <dc:creator>JUMMY</dc:creator>
      <dc:date>2019-01-30T03:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Fitting a model within a linear regression</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fitting-a-model-within-a-linear-regression/m-p/531359#M145416</link>
      <description>&lt;P&gt;Different slopes and intercepts for MAKE — you don't say which variable is the Y variable, so I have assumed it is COST, and that SPEED and MAKE are the X variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glm data=model;
    class make;
    model cost = make | speed;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The vertical bar in the MODEL statement gives you all mean effects involving MAKE and SPEED plus the interaction MAKE*SPEED. The coefficients for MAKE are the deviation of the separate intercepts from the overall intercept, and the interaction MAKE*SPEED are the adjustments to the overall slope so that you now have different slopes for the two different MAKE levels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 13:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fitting-a-model-within-a-linear-regression/m-p/531359#M145416</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-30T13:52:09Z</dc:date>
    </item>
  </channel>
</rss>

