<?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: P Value Insignificant but Residual Plot Great in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/P-Value-Insignificant-but-Residual-Plot-Great/m-p/838645#M41521</link>
    <description>&lt;P&gt;The relationship between y and x1 x2 in your data can be captured by using a regression between y and just the quadratic term.&amp;nbsp; Assuming X2 is X1*X1, try running.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PROC REG DATA=groupD17;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MODEL Y = X2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And compare the Rsquare with the original model.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is an example that will help you understand why a model with only a quadratic term and no linear term can fit well:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data examples(drop=i);&lt;BR /&gt;do i=1 to 1000;&lt;BR /&gt;x1=10*ranuni(213)-5;&lt;BR /&gt;x2=x1*x1;&lt;BR /&gt;/*y_only_quad is a difference of squares with no linear term&lt;BR /&gt;y_only_quad=x1^2-4 + N(0,1) error*/&lt;BR /&gt;y_only_quad=(x1+2)*(x1-2) + rannor(33);&lt;BR /&gt;/*y_lin_quad is a quadratic polynomial with a linear term &lt;BR /&gt;y_lin_quad=x1^2+4x+4 + N(0,1) error*/&lt;BR /&gt;y_lin_quad=(x1+2)*(x1+2) + rannor(89);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;ods graphics;&lt;BR /&gt;proc sgplot data=examples;&lt;BR /&gt;scatter x=x1 y=y_only_quad;&lt;BR /&gt;scatter x=x1 y=y_lin_quad;&lt;BR /&gt;refline 0 / axis=y;&lt;BR /&gt;refline 0 / axis=x;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;/*linear term will not be significant assuming alpha level 0.05&lt;BR /&gt;rsquare is 0.98*/&lt;BR /&gt;proc reg data=examples;&lt;BR /&gt;model y_only_quad= x1 x2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;/*remove linear term rsquare is still 0.98*/&lt;BR /&gt;proc reg data=examples;&lt;BR /&gt;model y_only_quad= x2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;/*run model where the linear term is required&lt;BR /&gt;the linear term is significant at alpha level 0.05*/&lt;BR /&gt;proc reg data=examples;&lt;BR /&gt;model y_lin_quad= x1 x2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 15:18:35 GMT</pubDate>
    <dc:creator>KevinScott</dc:creator>
    <dc:date>2022-10-14T15:18:35Z</dc:date>
    <item>
      <title>P Value Insignificant but Residual Plot Great</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/P-Value-Insignificant-but-Residual-Plot-Great/m-p/838639#M41519</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a model that has three parameters: intercept, x1, and x2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x1's p value is 0.7730&lt;/P&gt;&lt;P&gt;x2's p value is less than 0.0001&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But x1's residual plot looks really good and spread out&lt;/P&gt;&lt;P&gt;while x2's shows a quadratic U shape&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering why this is and what all goes into it. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS code&lt;BR /&gt;&lt;BR /&gt;DATA groupD17;&lt;BR /&gt;INPUT Y X1 X2;&lt;BR /&gt;DATALINES;&lt;BR /&gt;. . . data goes here . . .&lt;BR /&gt;;&lt;BR /&gt;PROC REG DATA=groupD17;&lt;BR /&gt;MODEL Y = X1 X2;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 14 Oct 2022 14:47:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/P-Value-Insignificant-but-Residual-Plot-Great/m-p/838639#M41519</guid>
      <dc:creator>jsconte18</dc:creator>
      <dc:date>2022-10-14T14:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: P Value Insignificant but Residual Plot Great</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/P-Value-Insignificant-but-Residual-Plot-Great/m-p/838642#M41520</link>
      <description>&lt;P&gt;You probably need to add a quadratic term for X2 in your model. Create a variable: x22=x2**2; and then include it in your MODEL statement.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 15:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/P-Value-Insignificant-but-Residual-Plot-Great/m-p/838642#M41520</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-10-14T15:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: P Value Insignificant but Residual Plot Great</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/P-Value-Insignificant-but-Residual-Plot-Great/m-p/838645#M41521</link>
      <description>&lt;P&gt;The relationship between y and x1 x2 in your data can be captured by using a regression between y and just the quadratic term.&amp;nbsp; Assuming X2 is X1*X1, try running.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PROC REG DATA=groupD17;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MODEL Y = X2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And compare the Rsquare with the original model.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is an example that will help you understand why a model with only a quadratic term and no linear term can fit well:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data examples(drop=i);&lt;BR /&gt;do i=1 to 1000;&lt;BR /&gt;x1=10*ranuni(213)-5;&lt;BR /&gt;x2=x1*x1;&lt;BR /&gt;/*y_only_quad is a difference of squares with no linear term&lt;BR /&gt;y_only_quad=x1^2-4 + N(0,1) error*/&lt;BR /&gt;y_only_quad=(x1+2)*(x1-2) + rannor(33);&lt;BR /&gt;/*y_lin_quad is a quadratic polynomial with a linear term &lt;BR /&gt;y_lin_quad=x1^2+4x+4 + N(0,1) error*/&lt;BR /&gt;y_lin_quad=(x1+2)*(x1+2) + rannor(89);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;ods graphics;&lt;BR /&gt;proc sgplot data=examples;&lt;BR /&gt;scatter x=x1 y=y_only_quad;&lt;BR /&gt;scatter x=x1 y=y_lin_quad;&lt;BR /&gt;refline 0 / axis=y;&lt;BR /&gt;refline 0 / axis=x;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;/*linear term will not be significant assuming alpha level 0.05&lt;BR /&gt;rsquare is 0.98*/&lt;BR /&gt;proc reg data=examples;&lt;BR /&gt;model y_only_quad= x1 x2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;/*remove linear term rsquare is still 0.98*/&lt;BR /&gt;proc reg data=examples;&lt;BR /&gt;model y_only_quad= x2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;/*run model where the linear term is required&lt;BR /&gt;the linear term is significant at alpha level 0.05*/&lt;BR /&gt;proc reg data=examples;&lt;BR /&gt;model y_lin_quad= x1 x2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 15:18:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/P-Value-Insignificant-but-Residual-Plot-Great/m-p/838645#M41521</guid>
      <dc:creator>KevinScott</dc:creator>
      <dc:date>2022-10-14T15:18:35Z</dc:date>
    </item>
  </channel>
</rss>

