<?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 Change in R square after adding multiple variables to a regression equation and significance test in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-in-R-square-after-adding-multiple-variables-to-a/m-p/232839#M42453</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider the following basic example, where "Add" is used to add two variables to an existing regression equation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg;
model Y=x1 x2;
run;
&amp;nbsp;
add x3 x4;
print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The print command after the "add" shows the new model and its R square. &amp;nbsp;However, it does not show the change (or delta) in R square from the first to the second model (as with full/nested models). &amp;nbsp;It also does not provide a signficance test (specifically, an F test) to determine if the new variables provide a significant change in R2. &amp;nbsp;How can I get SAS to provide the&amp;nbsp;change in R square and the accompanying significance test from the first to the second model?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: &amp;nbsp;Added request for significant test of change in R2.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Nov 2015 16:11:16 GMT</pubDate>
    <dc:creator>jpwiega</dc:creator>
    <dc:date>2015-11-03T16:11:16Z</dc:date>
    <item>
      <title>Change in R square after adding multiple variables to a regression equation and significance test</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-in-R-square-after-adding-multiple-variables-to-a/m-p/232839#M42453</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider the following basic example, where "Add" is used to add two variables to an existing regression equation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg;
model Y=x1 x2;
run;
&amp;nbsp;
add x3 x4;
print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The print command after the "add" shows the new model and its R square. &amp;nbsp;However, it does not show the change (or delta) in R square from the first to the second model (as with full/nested models). &amp;nbsp;It also does not provide a signficance test (specifically, an F test) to determine if the new variables provide a significant change in R2. &amp;nbsp;How can I get SAS to provide the&amp;nbsp;change in R square and the accompanying significance test from the first to the second model?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: &amp;nbsp;Added request for significant test of change in R2.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 16:11:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-in-R-square-after-adding-multiple-variables-to-a/m-p/232839#M42453</guid>
      <dc:creator>jpwiega</dc:creator>
      <dc:date>2015-11-03T16:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Change in R square after adding multiple variables to a regression equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-in-R-square-after-adding-multiple-variables-to-a/m-p/232848#M42454</link>
      <description>&lt;P&gt;If you give labels to your models :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=sashelp.class edf outest=r2 plots=none;
partial: model weight = height;
full: model weight = height age;
run;
quit;

data _null_;
set r2(where=(_model_="partial"));
R2_partial = _RSQ_;
set r2(where=(_model_="full"));
R2_full = _RSQ_;
R2_diff = R2_full - R2_partial;
put (R2_:) (percentn6.1);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Nov 2015 03:23:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-in-R-square-after-adding-multiple-variables-to-a/m-p/232848#M42454</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-11-03T03:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: Change in R square after adding multiple variables to a regression equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-in-R-square-after-adding-multiple-variables-to-a/m-p/232910#M42464</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm almost there, but two issues remain:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Most importantly, I want to determine if there is a significant change in R2 from one model to the next--my fault for not specifying this earlier--I'll update the initial post momentarily. &amp;nbsp;As such, I need not only the change in R2 from one model to the next, but an F statistic and p-value to determine whether the change after adding variables is significant.&lt;/LI&gt;
&lt;LI&gt;The output is presently in the log and not labeled. &amp;nbsp;Is there a way to get formatted output?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Of note, here is the actual syntax I'm using, please build from it if possible. &amp;nbsp;I'm adding to sets of variables to the initial equation. &amp;nbsp;So there are 3 models and two comparisons for change in R-square:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=pt8 edf outest=r2 plots=none;
   	Covariates: model jobSat= I IM A AM;
   	Linear: model jobSat= R RM I IM A AM;
	Quadratic: model jobSat= R RM RM2 R2 RInt I IM A AM;
run;
quit;

data _null_;
	set r2(where=(_model_="Covariates"));
		R2_Covariates = _RSQ_;
	set r2(where=(_model_="Linear"));
		R2_Linear = _RSQ_;
	set r2(where=(_model_="Quadratic"));
		R2_Quadratic = _RSQ_;
	R2_diff1 = R2_Linear - R2_Covariates;
	R2_diff2 = R2_Quadratic - R2_Linear;
	put (R2_:) (percentn6.1);
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2015 16:13:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-in-R-square-after-adding-multiple-variables-to-a/m-p/232910#M42464</guid>
      <dc:creator>jpwiega</dc:creator>
      <dc:date>2015-11-03T16:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Change in R square after adding multiple variables to a regression equation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-in-R-square-after-adding-multiple-variables-to-a/m-p/232991#M42502</link>
      <description>&lt;P&gt;You should get the proper tests with the &lt;STRONG&gt;test&lt;/STRONG&gt; statement in &lt;STRONG&gt;proc reg:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc reg data=pt8 edf outest=r2 plots=none;
   	Covariates: model jobSat= I IM A AM;
   	Linear: model jobSat= R RM I IM A AM;
	LinTest: test R=0, RM=0;
	Quadratic: model jobSat= R RM RM2 R2 RInt I IM A AM;
	QuadTest: test RM2=0, R2=0, RInt=0;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Nov 2015 22:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-in-R-square-after-adding-multiple-variables-to-a/m-p/232991#M42502</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-11-03T22:40:28Z</dc:date>
    </item>
  </channel>
</rss>

