Description Usage Arguments Value

Simulates a dataset from either Cragg or Lognormal distributions. Allows you to specify the data generating process, though it still can't handle more than one endogenous regression

1 2 3 4 5 | ```
hurdle.IV.sim(formula = F, pi = c(1, -1, 3), gamma = c(-0.2, 0.8, 0.07),
beta = c(0.05, 0.06, 0.02), endog_reg = list(), exog_mean = 1,
exog_sd = 1, z_mean = 3, z_sd = 1, endog_sd = 5, y_sd = 2,
rho = 0.2, tau0 = 0.3, tau1 = 0.1, n = 10000, options = list(silent
= F, cragg_errors = 4), type = "lognormal")
``` |

`formula` |
For now, must be False. In the future, will allow you to leave out exogenous variables you use in first stage regressions from second stage regressions. |

`pi` |
a vector of the coefficients on your first stage regression. Should be in the order: intercept, exogenous variables, instruments. Defaults to (1,-1,3). |

`gamma` |
a vector of the coefficients on your second stage probit regression. Should be in the order: intercept, exogenous variables, endogenous variable. Defaults to (-.2,.8,.07) |

`beta` |
a vector of the coefficients on your second stage linear regression. Should be in the order: intercept, exogenous variables, endogenous variable. Defaults to (.05,.06,.02) |

`endog_reg` |
for now, leave as an empty list. Will create one endogenous regression which includes the instrument and all exogenous variables |

`exog_mean` |
the mean(s) of your exogenous variable(s). Defaults to 1 |

`exog_sd` |
the standard deviation(s) of your exogenous variable(s). Defaults to 1. |

`z_mean` |
the mean(s) of your instrument(s). Defaults to 3. |

`z_sd` |
the standard deviation(s) of your instrument(s). Defaults to 1. |

`y_sd` |
the standard deviation of your second stage linear regression. Defaults to 2. |

`rho` |
the covariance term between second stage linear and probit regressions. Defaults to 0.2. |

`tau0` |
the covariance term between the second stage probit and the first stage regression. Defaults to 0.3. |

`tau1` |
the covariance term between the second stage linear regression and the first stage regression. Defaults to 0.1. |

`n` |
the number of observations. Defaults to 10,000. |

`options` |
Options are: silent = F (will print histograms and percent censored), cragg_errors = 1,2,3,4 cragg error type 4 will generate x2 and y0 first, then generate y1 from a conditional distribution on the first two and on itself being positive. See documentation for cragg_errs for more detail. |

`type` |
defaults to lognormal. Enter "cragg" for cragg model. |

returns a simulated dataset

jackiemauro/hurdleIV documentation built on April 2, 2018, 8:28 p.m.

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.