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.;