Description Usage Arguments Value
View source: R/cragg_errors_dChoi.R
There are a bunch of ways of thinking about this DGP. This is (I think) what Dave Choi had in mind. This can only handle one endogenous variable and one exogenous variable for now. Note that this is very similar to cragg3, but we resample all of y1 when y0 is not zero. Also note that this is a little weird in that the x2 we end up observing is not the exact same one we used in generating y0. So there may be rows in the data where the observed x2 would lead to a negative y0 but we still observe a positive value of y1.
1 | cragg_errs_DC(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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.