jkcshea / ivmte

An R package for implementing the method in Mogstad, Santos, and Torgovitsky (2018, Econometrica).
GNU General Public License v3.0
18 stars 2 forks source link

Various bootstrap errors #230

Closed jkcshea closed 1 year ago

jkcshea commented 1 year ago
  1. Variables are sometimes dropped from the propensity model because of collinearity. This creates a problem because I cbind() the coefficient estimates across bootstrap iterations to store them. One such problem is a conformability error, which occurs when a different number of variables are dropped across bootstrap iterations. I should use merge() to collect and store the coefficient estimates.

  2. If a numerical error occurs when estimating the bounds in one of the bootstrap iterations, an error pops up and the function terminates. Nothing is returned to the user. The function should be corrected to return whatever bounds could be estimated, along with a warning.

jkcshea commented 1 year ago

Resolved!

  1. ivmte now does a better job tracking variables that are kept in/dropped from the propensity score model. When displaying the standard errors and confidence intervals for coefficients in the propensity model, ivmte also shows how many bootstraps contained each variable.

  2. I forgot that we decided to resample the data whenever a bootstrap iteration fails (see issue #126). So ivmte now redraws the bootstrap sample whenever there is a numerical error when estimating the bounds. The output continues to report the number of bootstrap iterations that had to be repeated.