Description Usage Arguments Details Author(s)

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.

1 |

`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 ( |

`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.

Gabriele Rovigatti

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.