Hello everyone,
I am using GMM estimation to fit a logit model of Y on endogenous variable X with Z as instrument, conditional on boy1 age age2 birthage1 mom_eduyr dad_eduyr rural mom_eth dad_eth birthyr dad_birthy dprovcn2-dprovcn30.
It is a cross section data that including around 50000 households. My stata version is Stata/IC 13.1.
Example of my data
The regressors including 12 variables(some of them are dummies) and 29 state dummies dprovcn2-dprovcn30,
Previously, I included dummy variables without prefix i. and I was able to obtain GMM estimators. See below, here I am not including all the output.
However, when I tries to specify dummy variables with prefix i., stata returned error message "could not evaluate equation 1 r(498)".
Previously state dummies were generated based on variable provcn, here I use i.provcn for ease.
I do not understand what went wrong. I prefer to specify categorical nature of the data so that I can calculate marginal effects afterwards, but it seems GMM command cannot cope with this issue. Anybody has suggestions?
Also, does anybody has advice on computing marginal effects after GMM estimation?
Many thanks
Yi
I am using GMM estimation to fit a logit model of Y on endogenous variable X with Z as instrument, conditional on boy1 age age2 birthage1 mom_eduyr dad_eduyr rural mom_eth dad_eth birthyr dad_birthy dprovcn2-dprovcn30.
It is a cross section data that including around 50000 households. My stata version is Stata/IC 13.1.
Example of my data
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float boy1 byte age float(age2 birthage1 mom_eduyr dad_eduyr rural mom_eth dad_eth) 0 13 9 26 14 16 0 1 1 0 10 7 25 12 9 0 1 1 1 10 9 25 9 9 0 1 1 0 13 10 25 9 9 1 1 1 1 7 2 31 6 9 1 0 0 0 7 3 23 9 9 1 0 0
Previously, I included dummy variables without prefix i. and I was able to obtain GMM estimators. See below, here I am not including all the output.
Code:
global xlist boy1 age age2 birthage1 mom_eduyr dad_eduyr rural mom_eth dad_eth dprovcn2-dprovcn30 . . global xb "{X}*X + {boy1}*boy1 + {age}*age + {age_2}*age_2 + {birthage1}*birthage1 + {mom_eduyr}*mom_ed> uyr + {dad_eduyr}*dad_eduyr + {rural}*rural + {mom_eth}*mom_eth + {dad_eth}*dad_eth + {dprovcn2}*dprovcn2+{dprovcn3}*dprovcn3+{dprovcn4}*dprovcn4+{dprovcn5}*dprovcn5+{dprovcn6}*dprovcn6+{dprovcn7}*dprovcn7 +{dprovcn8}*dprovcn8+{dprovcn9}*dprovcn9+{dprovcn10}*dprovcn10+{dprovcn11}*dprovcn11+{dprovcn12}*dprovcn12+{dprovcn13}*dprovcn13+{dprovcn13}*dprovcn13+{dprovcn13}*dprovcn13+{dprovcn14}*dprovcn14+{dprovcn14} *dprovcn14+{dprovcn15}*dprovcn15+{dprovcn16}*dprovcn16+{dprovcn17}*dprovcn17+{dprovcn18}*dprovcn18+{dprovcn19}*dprovcn19+{dprovcn20}*dprovcn20+{dprovcn21}*dprovcn21+{dprovcn22}*dprovcn22+{dprovcn23}*dprovcn23+{dprovcn24}*dprovcn24+{dprovcn25}*dprovcn25+{dprovcn26}*dprovcn26+{dprovcn27}*dprovcn27+{dprovcn28}*dprovcn28+{dprovcn29}*dprovcn29+{dprovcn30}*dprovcn30 + {cons}" . global Ey "exp($xb)/(1+exp($xb))" gmm (Y-$Ey), instruments(Z $xlist) vce(robust) Step 1 Iteration 0: GMM criterion Q(b) = .15719873
Previously state dummies were generated based on variable provcn, here I use i.provcn for ease.
Code:
global xlist_new i.boy1 age c.age#c.age birthage1 mom_eduyr dad_eduyr rural i.mom_eth i.dad_eth i.provcn . global xb "{X}*X + {boy1}*1.boy1 + {age}*age + {age_2}*c.age#c.age + {birthage1}*birthage1 + {mom_eduyr }*mom_eduyr + {dad_eduyr}*dad_eduyr + {rural}*rural + {mom_eth}*i.mom_eth + {dad_eth}*i.dad_eth + {provcn}*i.provcn + {cons}" . . global Ey "exp($xb)/(1+exp($xb))" . . gmm (Y-$Ey), instruments(Z $xlist) vce(robust) could not evaluate equation 1 r(498);
Also, does anybody has advice on computing marginal effects after GMM estimation?
Many thanks
Yi
Comment