Description Usage Arguments Value

View source: R/cragg_errors1.R

The truncated multivariate normal errors can be generated in one of two ways. Either we sample the first stage and probit errors first and then resample the linear regression's errors until we have positive values, or we resample the vector of all three errors until the linear value is positive. This is the first method, use cragg_errors2 for the second, which is more intuitive.

1 | ```
cragg_errs1(cov, pi, x1, gamma, beta, n, z)
``` |

`cov` |
the covariance matrix. This should be untransformed, the terms will be multiplied by the coefficients within the resampling procedure. |

`pi` |
a vector of coefficients for the first stage regression |

`x1` |
your exogenous variables (a dataframe) |

`gamma` |
a vector of coefficients for the second stage probit |

`beta` |
a vector of coefficients for the second stage linear regression |

`n` |
the number of errors to be generated |

`z` |
your instrument (a dataframe) |

returns a list of your errors and the three generated variables: the endogenous regressor, the censoring variable and the outcome variable

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.