#load dataset dataCopC1, where P is endogenous, continuous and not normally distributed
data(dataCopC1)
y <- dataCopC1[,1]
X <- dataCopC1[,2:5]
P <- dataCopC1[,5]
## Not run: ------------------------------------
# c1 <- copulaCorrection(y, X, P, type = "continuous", method = "1", intercept=FALSE)
# summary(c1)
## ---------------------------------------------
# an alternative model can be obtained using "method ="2"".
c12 <- copulaCorrection(y, X, P, type = "continuous", method = "2", intercept=FALSE)
summary(c12)
# with 2 endogeneous regressors no initial parameters are needed, the default is the augmented OLS.
data(dataCopC2)
y <- dataCopC2[,1]
X <- dataCopC2[,2:6]
P <- dataCopC2[,5:6]
c2 <- copulaCorrection(y, X, P, type = "continuous" ,method="2", intercept=FALSE)
summary(c2)
# load dataset with 1 discrete endogeneous variable.
# having more than 1 discrete endogenous regressor is also possible
data(dataCopDis)
y <- dataCopDis[,1]
X <- dataCopDis[,2:5]
P <- dataCopDis[,5]
c3 <- copulaCorrection(y, X, P, type = "discrete", intercept=FALSE, data = dataCopDis)
summary(c3)
Run the code above in your browser using DataLab