In a Wooldridge estimation setting, i.e., in a system GMM framework, this function returns the optimal weighting matrix or the variance-covariance matrix given 1st or 2nd stage estimation results.
weightM(Y, X1, X2, Z1, Z2, betas, numR, SE = FALSE)
Vector of log(value added output).
Matrix of regressors for the first equation.
Matrix of regressors for the second equation.
Matrix of instruments for the first equation.
Matrix of instruments for the second equation.
Vector of first/second stage parameter estimates.
Number of state + number of free + number of control variables (i.e., number of constrained parameters).
Binary indicator for first (SE == FALSE
, the default) or second stage.
weightM()
accepts at least 7 inputs: Y, X1, X2, Z1, Z2, betas and numR. With these, computes the optimal weighting matrix in a system GMM framework, i.e. W* = sigma*Z'Z. If it is called during the first stage, it returns W*, otherwise will return an estimate of the parameters' standard errors, i.e., the square root of the diagonal of the variance-covariance matrix: 1/N( (X'Z) W* (Z'X) )^-1.