cragg_errs_MG: Resample for truncated normal errors

Description Usage Arguments Value

View source: R/cragg_errors_MG.R

Description

There are a bunch of ways of thinking about this DGP. This is what Max G'Sell had in mind. We generate x2 and y0 first, and then sample from y1 conditionally on those two and on itself being positive. This can only handle one endogenous variable for now. Testing it with more than one exogenous variable.

Usage

1
cragg_errs_MG(cov, pi, x1, gamma, beta, n, z)

Arguments

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)

Value

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


jackiemauro/hurdleIV documentation built on May 18, 2019, 7:56 a.m.