weightM: Generate optimal GMM weighting matrix

Description Usage Arguments Details Author(s)

View source: R/auxFun.R

Description

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.

Usage

1
  weightM(Y, X1, X2, Z1, Z2, betas, numR, SE = FALSE)

Arguments

Y

Vector of log(value added output).

X1

Matrix of regressors for the first equation.

X2

Matrix of regressors for the second equation.

Z1

Matrix of instruments for the first equation.

Z2

Matrix of instruments for the second equation.

betas

Vector of first/second stage parameter estimates.

numR

Number of state + number of free + number of control variables (i.e., number of constrained parameters).

SE

Binary indicator for first (SE == FALSE, the default) or second stage.

Details

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.

Author(s)

Gabriele Rovigatti


prodest documentation built on June 20, 2018, 5:04 p.m.