Hey guys,
I am running a two-step joint dynamic panel GMM estimator on Mata, with the stacked formula: b = (inv(x'*z*inv(z'*(e*e')*z)*z'*x))*(x'*z*inv(z'*(e* e')*z)*z'*y), where x refers to matrix of regressors, z refers to matrix of instrumental variables and e refers to vector of (1st-Step) residuals.
For the above two step formula, for a single equation, I calculate the variance of the moment conditions (z'*(e*e')*z), (let's call it S) as first step towards deriving cross-section heteroscedasticity robust weighing matrix
k = cols(z)
st_view(id=. , . , ("id"))
info = panelsetup(id,1)
nc = rows(info)
S= J(k,k,0)
for(i=1; i<=nc; i++) {
panelsubview(zi = . , z , i , info)
panelsubview(ei = . , e , i , info)
S = S + zi'*(ei*ei')*ei
}
The problem arises since I have a large number of cross-sections in my panel dataset, which has 2941 cross-sectional units spread across 14 years. Thus the matrix S at the end of the loop is giving null values. Where am I going wrong ? On datasets with shorter cross-sectional counts, I can calculate S just fine, but in this instance the S matrix is returning null / no values. Any other way I may derive the S matrix ?
Related Posts with Two - step dynamic panel GMM estimator weight Matrix returning blank value after Mata loop
Index of Net DifferencesHi, I am calculating Lieberson's Index of Net Differences in Stata: [ATTACH=CONFIG]temp_14048_1554…
Problem with triple difference-in-difference results and interpretationDear Statalist users, I am using a triple difference-in-difference strategy to try and establish th…
marginal results for melogitI am modeling a proportion (numerator/denominator where the denominator represents the number of tri…
Calculating probabilities for Multinomial Logit with Fixed Effects (femlogit)Dear Stata Gurus, I am using using the Multinomial Logit with Fixed Effects (femlogit) program to e…
Testing for a Valid Instrumental VariableHi Statalisters, I am in the process of looking for a suitable instrument for gender inequality, as…
Subscribe to:
Post Comments (Atom)
0 Response to Two - step dynamic panel GMM estimator weight Matrix returning blank value after Mata loop
Post a Comment