Open pschil opened 4 years ago
I was skimming through the code and issues, but couldn't easily discern whether the estimation with multiple endogenous regressors is supported already. When using OLS, it should be enough to use the copula transformation function (i.e., to extract the normally-distributed and potentially endogenous part of PStar), and inserting that as an additional regressor for each potentially endogenous variable. Should be straightforward to implement. The function may be sensitive to the increment to prevent qnorm to evaluate to NA.
make_copula <- function(x, increment = .00001) {
if (length(unique(x))==1) return(as.numeric(rep(NA, length(x))))
return(ifelse(ecdf(x)(x)==1, qnorm(1-increment), qnorm(ecdf(x)(x))))
}
Copula correction method with multiple endogenous regressors is already implemented, as explained also in the vignette: https://rdrr.io/cran/REndo/f/vignettes/REndo-introduction.Rmd
Currently, the case of a single continuous endogenous regressor in copulaCorrection can only be estimated using LL. Because bootstrapping with LL takes much longer it would be convenient to also provide the possibility to use enhanced OLS. As by Raluca, this would theoretically be correct as shown in the paper by Park and Gupta.
Suggested syntax: use
continuousLL()
andcontinuousOLS()
to mark the regressors in favour ofcontinuous()
which should be depreciated.This is not expected to be implemented in the near future.