<?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 Proc panel with GMM and two regressions in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Proc-panel-with-GMM-and-two-regressions/m-p/133933#M781</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to model an Almost Ideal Demand System on dynamic panel data &lt;A href="http://support.sas.com/rnd/app/examples/ets/aids/" title="http://support.sas.com/rnd/app/examples/ets/aids/"&gt; SAS/ETS Examples -- Estimating an Almost Ideal Demand System Model &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a data set that consists of observations over 20 years and 18 cohorts (age groups). I need to use a GMM method since it is a dynamic equation. However, I have to model two regressions at once, and I am really quite not sure how I do that with proc panel? Do I repeat the model statement twice? Any help will be greatly appreciated! Here come the eqautions and the RESTRICTIONS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I have 18 cohorts, I would like to regress this for EACH cohort (each group age). Do I use the BY statement for that purpose?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;mean_w_alco = a10 + g11*log(norm_p_alco/norm_p_othe&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;r) + g12*log(norm_p_toba/norm_p_&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;other) + g1*log(norm_p_other) + b1*log(exp_tot/Laspeyres) + c1*z&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;mean_w_toba = a20 + g21*log(norm_p_alco/norm_p_other) + g22*log(norm_p_toba/norm_p_other) + g2*log(norm_p_other) + b2*log(exp_tot/Laspeyres) + c2*z&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;restrictions:&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;g12=-g11;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;g21=-g22;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;g12=g21;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;b2=-b1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;c2=-c1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;a20=1-a10;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;Would I do :&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;proc panel data=equa1;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by age;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;model&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;mean_w_alco = a10 + g11*log(norm_p_alco/norm_p_othe&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;r) + g12*log(norm_p_toba/norm_p_&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;other) + g1*log(norm_p_other) + b1*log(exp_tot/Laspeyres) + c1*z+e+E1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;mean_w_toba = a20 + g21*log(norm_p_alco/norm_p_other) + g22*log(norm_p_toba/norm_p_other) + g2*log(norm_p_other) + b2*log(exp_tot/Laspeyres) + c2*z+e+E2;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;g12=-g11;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;g21=-g22;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;g12=g21;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;b2=-b1;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;c2=-c1;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;a20=1-a10;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;solve g12 g11 g21 g22 b2 b1 c2 c1 a20 a10;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;quit;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;? It doesn't seem to work when I run this on SAS.;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 May 2013 08:53:36 GMT</pubDate>
    <dc:creator>seigna</dc:creator>
    <dc:date>2013-05-13T08:53:36Z</dc:date>
    <item>
      <title>Proc panel with GMM and two regressions</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Proc-panel-with-GMM-and-two-regressions/m-p/133933#M781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to model an Almost Ideal Demand System on dynamic panel data &lt;A href="http://support.sas.com/rnd/app/examples/ets/aids/" title="http://support.sas.com/rnd/app/examples/ets/aids/"&gt; SAS/ETS Examples -- Estimating an Almost Ideal Demand System Model &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a data set that consists of observations over 20 years and 18 cohorts (age groups). I need to use a GMM method since it is a dynamic equation. However, I have to model two regressions at once, and I am really quite not sure how I do that with proc panel? Do I repeat the model statement twice? Any help will be greatly appreciated! Here come the eqautions and the RESTRICTIONS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I have 18 cohorts, I would like to regress this for EACH cohort (each group age). Do I use the BY statement for that purpose?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;mean_w_alco = a10 + g11*log(norm_p_alco/norm_p_othe&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;r) + g12*log(norm_p_toba/norm_p_&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;other) + g1*log(norm_p_other) + b1*log(exp_tot/Laspeyres) + c1*z&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;mean_w_toba = a20 + g21*log(norm_p_alco/norm_p_other) + g22*log(norm_p_toba/norm_p_other) + g2*log(norm_p_other) + b2*log(exp_tot/Laspeyres) + c2*z&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;restrictions:&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;g12=-g11;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;g21=-g22;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;g12=g21;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;b2=-b1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;c2=-c1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;STRONG&gt;a20=1-a10;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;Would I do :&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;proc panel data=equa1;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by age;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;model&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;mean_w_alco = a10 + g11*log(norm_p_alco/norm_p_othe&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;r) + g12*log(norm_p_toba/norm_p_&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: #ffffff;"&gt;other) + g1*log(norm_p_other) + b1*log(exp_tot/Laspeyres) + c1*z+e+E1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;mean_w_toba = a20 + g21*log(norm_p_alco/norm_p_other) + g22*log(norm_p_toba/norm_p_other) + g2*log(norm_p_other) + b2*log(exp_tot/Laspeyres) + c2*z+e+E2;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;g12=-g11;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;g21=-g22;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;g12=g21;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;b2=-b1;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;c2=-c1;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;a20=1-a10;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;solve g12 g11 g21 g22 b2 b1 c2 c1 a20 a10;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;quit;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.727272033691406px; color: #222222; font-family: arial, sans-serif; background-color: #ffffff;"&gt;? It doesn't seem to work when I run this on SAS.;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2013 08:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Proc-panel-with-GMM-and-two-regressions/m-p/133933#M781</guid>
      <dc:creator>seigna</dc:creator>
      <dc:date>2013-05-13T08:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc panel with GMM and two regressions</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Proc-panel-with-GMM-and-two-regressions/m-p/133934#M782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello -&lt;/P&gt;&lt;P&gt;Sharing feedback from one of my colleagues in SAS R&amp;amp;D who works on the new SSM procedure, which you may find useful.&lt;/P&gt;&lt;P&gt;Note that SSM is experimental with 12.1: &lt;A href="http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#ssm_toc.htm"&gt;http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#ssm_toc.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Udo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user has two response variables, say Y1 and Y2 and response variables X1-X4 and Z.&amp;nbsp; The models are:&lt;BR /&gt;Y1 = a1 + g11 X1 + g12 X2 + g1 X3 + b1 X4 + c1 Z + e1&lt;BR /&gt;Y2 = (1-a1) + g21 X1 + g22 X2 + g2 X3 + b2 X4 + c2 Z + e2&lt;/P&gt;&lt;P&gt;Where &lt;BR /&gt;1.&amp;nbsp; g11 = -g12 and g21 = -g22&lt;BR /&gt;2. G12 = g21&lt;BR /&gt;3. B2 = -b1&lt;BR /&gt;4. C2 = -c1&lt;/P&gt;&lt;P&gt;These restrictions can be imposed by redefining some variables:&lt;BR /&gt;The first restriction can be achieved by using (X1 – X2) as a single variable in place of X1 and X2.&amp;nbsp; Let us call this its coefficient as G.&amp;nbsp; Now the second restriction says that the coefficient G is to be the same for the two models (Y1 and Y2).&lt;/P&gt;&lt;P&gt;This can be achieved in SSM by treating the regression coefficient as a state element.&amp;nbsp; See the section “Regression Variable Specification in Multivariate Models” in the SSM doc (Details-&amp;gt;Overview of Model Specification Syntax).&lt;/P&gt;&lt;P&gt;Similar things can be done for a,B and C parameters.&amp;nbsp; The user’s models appear simple reg models.&amp;nbsp; He can specify more general error structures to account for time variation if that is desired.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 19:00:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/Proc-panel-with-GMM-and-two-regressions/m-p/133934#M782</guid>
      <dc:creator>udo_sas</dc:creator>
      <dc:date>2013-05-22T19:00:12Z</dc:date>
    </item>
  </channel>
</rss>

