BookmarkSubscribeRSS Feed
seigna
Calcite | Level 5

I am trying to model an Almost Ideal Demand System on dynamic panel data SAS/ETS Examples -- Estimating an Almost Ideal Demand System Model

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.

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?

mean_w_alco = a10 + g11*log(norm_p_alco/norm_p_other) + g12*log(norm_p_toba/norm_p_other) + g1*log(norm_p_other) + b1*log(exp_tot/Laspeyres) + c1*z

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

restrictions:

g12=-g11;

g21=-g22;

g12=g21;

b2=-b1;

c2=-c1;

a20=1-a10;

Would I do :

proc panel data=equa1;

     by age;

model

mean_w_alco = a10 + g11*log(norm_p_alco/norm_p_other) + g12*log(norm_p_toba/norm_p_other) + g1*log(norm_p_other) + b1*log(exp_tot/Laspeyres) + c1*z+e+E1

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;

g12=-g11;

g21=-g22;

g12=g21;

b2=-b1;

c2=-c1;

a20=1-a10;

solve g12 g11 g21 g22 b2 b1 c2 c1 a20 a10;

run;

quit;

? It doesn't seem to work when I run this on SAS.;

1 REPLY 1
udo_sas
SAS Employee

Hello -

Sharing feedback from one of my colleagues in SAS R&D who works on the new SSM procedure, which you may find useful.

Note that SSM is experimental with 12.1: http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#ssm_toc.htm

Thanks,

Udo

The user has two response variables, say Y1 and Y2 and response variables X1-X4 and Z.  The models are:
Y1 = a1 + g11 X1 + g12 X2 + g1 X3 + b1 X4 + c1 Z + e1
Y2 = (1-a1) + g21 X1 + g22 X2 + g2 X3 + b2 X4 + c2 Z + e2

Where
1.  g11 = -g12 and g21 = -g22
2. G12 = g21
3. B2 = -b1
4. C2 = -c1

These restrictions can be imposed by redefining some variables:
The first restriction can be achieved by using (X1 – X2) as a single variable in place of X1 and X2.  Let us call this its coefficient as G.  Now the second restriction says that the coefficient G is to be the same for the two models (Y1 and Y2).

This can be achieved in SSM by treating the regression coefficient as a state element.  See the section “Regression Variable Specification in Multivariate Models” in the SSM doc (Details->Overview of Model Specification Syntax).

Similar things can be done for a,B and C parameters.  The user’s models appear simple reg models.  He can specify more general error structures to account for time variation if that is desired.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 809 views
  • 0 likes
  • 2 in conversation