<?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 how to find pairwise residual correlations after 2sls estimation using proc model in sas? in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/how-to-find-pairwise-residual-correlations-after-2sls-estimation/m-p/533018#M3429</link>
    <description>&lt;P&gt;i'm using 2sls to estimate my model which contains 7 dependent variables: Y1,Y2,Y3,Y4,Y5,Y6,Y7.&amp;nbsp; There is no problem to run the code, however, i want to save the residuals from these estimations, and i want to find the pairwise residual correlations of these residuals and print them out.&amp;nbsp; how can i code this into the proc model ?&lt;/P&gt;&lt;P&gt;here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc model data=main;&lt;BR /&gt;Y1=a0+a1*lag(Y1)+&lt;BR /&gt;a5*(W1_2*Y2 + W1_3*Y3 + W1_4*Y4 + W1_5*Y5 + W1_6*Y6 +W1_7*Y7)+&lt;BR /&gt;a6*lag(W1_2*Y2 + W1_3*Y3 + W1_4*Y4 + W1_5*Y5 + W1_6*Y6 +W1_7*Y7)+&lt;BR /&gt;a7*lag2(W1_2*Y2 + W1_3*Y3 + W1_4*Y4 + W1_5*Y5 + W1_6*Y6 +W1_7*Y7)+&lt;BR /&gt;a8*lag3(W1_2*Y2 + W1_3*Y3 + W1_4*Y4 + W1_5*Y5 + W1_6*Y6 +W1_7*Y7) +&lt;BR /&gt;a9*lag4(W1_2*Y2 + W1_3*Y3 + W1_4*Y4 + W1_5*Y5 + W1_6*Y6 +W1_7*Y7);&lt;BR /&gt;Y2=b0+b1*lag(Y2)+&lt;BR /&gt;b5*(W2_1*Y1 + W2_3*Y3 + W2_4*Y4 + W2_5*Y5 + W2_6*Y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Y3 + W7_4*Y4 + W7_5*Y5 + W7_6*Y6)+&lt;BR /&gt;g6*lag(W7_1*Y1 + W7_2*Y2 + W7_3*Y3 + W7_4*Y4 + W7_5*Y5 + W7_6*Y6)+&lt;BR /&gt;g7*lag2(W7_1*Y1 + W7_2*Y2 + W7_3*Y3 + W7_4*Y4 + W7_5*Y5 + W7_6*Y6)+&lt;BR /&gt;g8*lag3(W7_1*Y1 + W7_2*Y2 + W7_3*Y3 + W7_4*Y4 + W7_5*Y5 + W7_6*Y6)+&lt;BR /&gt;g9*lag4(W7_1*Y1 + W7_2*Y2 + W7_3*Y3 + W7_4*Y4 + W7_5*Y5 + W7_6*Y6);&lt;BR /&gt;endogenous Y1-Y7;&lt;BR /&gt;exogenous W1_2-W1_7 W2_1 W2_3-W2_7 W3_1 W3_2 W3_4-W3_7 W4_1-W4_3 W4_5-W4_7&lt;BR /&gt;W5_1-W5_4 W5_6-W5_7 W6_1-W6_5 W6_7 W7_1-W7_6;&lt;BR /&gt;instruments y1_1-y1_4 y2_1-y2_4 y3_1-y3_4 y4_1-y4_4 y5_1-y5_4 y6_1-y6_4&lt;BR /&gt;y7_1-y7_4;&lt;BR /&gt;parms a0 a1 a5-a9 b0 b1 b5-b9 c0 c1 c5-c9 d0 d1 d5-d9 e0 e1 e5-e9 f0 f1 f5-f9 g0 g1 g5-g9;&lt;BR /&gt;range nyear= 1996.1 to 2017.4;&lt;BR /&gt;fit Y1-Y7/2sls outest=eat1.est1;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Feb 2019 17:20:47 GMT</pubDate>
    <dc:creator>linaad</dc:creator>
    <dc:date>2019-02-05T17:20:47Z</dc:date>
    <item>
      <title>how to find pairwise residual correlations after 2sls estimation using proc model in sas?</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/how-to-find-pairwise-residual-correlations-after-2sls-estimation/m-p/533018#M3429</link>
      <description>&lt;P&gt;i'm using 2sls to estimate my model which contains 7 dependent variables: Y1,Y2,Y3,Y4,Y5,Y6,Y7.&amp;nbsp; There is no problem to run the code, however, i want to save the residuals from these estimations, and i want to find the pairwise residual correlations of these residuals and print them out.&amp;nbsp; how can i code this into the proc model ?&lt;/P&gt;&lt;P&gt;here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc model data=main;&lt;BR /&gt;Y1=a0+a1*lag(Y1)+&lt;BR /&gt;a5*(W1_2*Y2 + W1_3*Y3 + W1_4*Y4 + W1_5*Y5 + W1_6*Y6 +W1_7*Y7)+&lt;BR /&gt;a6*lag(W1_2*Y2 + W1_3*Y3 + W1_4*Y4 + W1_5*Y5 + W1_6*Y6 +W1_7*Y7)+&lt;BR /&gt;a7*lag2(W1_2*Y2 + W1_3*Y3 + W1_4*Y4 + W1_5*Y5 + W1_6*Y6 +W1_7*Y7)+&lt;BR /&gt;a8*lag3(W1_2*Y2 + W1_3*Y3 + W1_4*Y4 + W1_5*Y5 + W1_6*Y6 +W1_7*Y7) +&lt;BR /&gt;a9*lag4(W1_2*Y2 + W1_3*Y3 + W1_4*Y4 + W1_5*Y5 + W1_6*Y6 +W1_7*Y7);&lt;BR /&gt;Y2=b0+b1*lag(Y2)+&lt;BR /&gt;b5*(W2_1*Y1 + W2_3*Y3 + W2_4*Y4 + W2_5*Y5 + W2_6*Y6 + W2_7*Y7)+&lt;BR /&gt;b6*lag(W2_1*Y1 + W2_3*Y3 + W2_4*Y4 + W2_5*Y5 + W2_6*Y6 + W2_7*Y7)+&lt;BR /&gt;b7*lag2(W2_1*Y1 + W2_3*Y3 + W2_4*Y4 + W2_5*Y5 + W2_6*Y6 + W2_7*Y7)+&lt;BR /&gt;b8*lag3(W2_1*Y1 + W2_3*Y3 + W2_4*Y4 + W2_5*Y5 + W2_6*Y6 + W2_7*Y7)+&lt;BR /&gt;b9*lag4(W2_1*Y1 + W2_3*Y3 + W2_4*Y4 + W2_5*Y5 + W2_6*Y6 + W2_7*Y7);&lt;BR /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*Y5 + W7_6*Y6);&lt;BR /&gt;endogenous Y1-Y7;&lt;BR /&gt;exogenous W1_2-W1_7 W2_1 W2_3-W2_7 W3_1 W3_2 W3_4-W3_7 W4_1-W4_3 W4_5-W4_7&lt;BR /&gt;W5_1-W5_4 W5_6-W5_7 W6_1-W6_5 W6_7 W7_1-W7_6;&lt;BR /&gt;instruments y1_1-y1_4 y2_1-y2_4 y3_1-y3_4 y4_1-y4_4 y5_1-y5_4 y6_1-y6_4&lt;BR /&gt;y7_1-y7_4;&lt;BR /&gt;parms a0 a1 a5-a9 b0 b1 b5-b9 c0 c1 c5-c9 d0 d1 d5-d9 e0 e1 e5-e9 f0 f1 f5-f9 g0 g1 g5-g9;&lt;BR /&gt;range nyear= 1996.1 to 2017.4;&lt;BR /&gt;fit Y1-Y7/2sls outest=eat1.est1;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 17:20:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/how-to-find-pairwise-residual-correlations-after-2sls-estimation/m-p/533018#M3429</guid>
      <dc:creator>linaad</dc:creator>
      <dc:date>2019-02-05T17:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to find pairwise residual correlations after 2sls estimation using proc model in sas?</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/how-to-find-pairwise-residual-correlations-after-2sls-estimation/m-p/534307#M3430</link>
      <description>&lt;P&gt;Have you looked at the FIT statement documentation?&amp;nbsp;&amp;nbsp;I see an "outresid=" parameter that makes a dataset of residuals, which you can then submit to proc corr.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 16:58:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/how-to-find-pairwise-residual-correlations-after-2sls-estimation/m-p/534307#M3430</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2019-02-10T16:58:17Z</dc:date>
    </item>
  </channel>
</rss>

