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
Adjusting decimals points with asdoc not working?Hi, I am using asdoc to output my regression results. Here is my code: Code: mixed wages c.cage##i…
Including confidence intervals in estimate plotsI have a dataset in which per country, the estimates of coefficients are given as well as their t sc…
Why set maxvar is ignored?When I set maxvar and STATA return as below, can I ask why and the solution? Code: set matsize 110…
Creating a stacked bar chart for 3 different variablesHello Statalis, I have done a conjoint experiment survey, where respondents were asked to choose be…
STATA stuck computing matchit resultsI am attempting to match two datasets, one of which is about 70 000 observations and the other maybe…
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