I am trying to correct for endogeneity using Gaussian Copula. The model has 1 continuous endogenous regressor (i.e., MACHF) , one dependent variable (i.e., LEXP), and one control variable (i.e., COLLHIST). I first ran a MULTIPLE REGRESSION . The model runs well and there is no error. Following this step, I am trying to correct for endogeneity using Gaussian Copula in REndo using RStudio. I followed the steps suggested by Raluca Gui , but I get the below errors
cc <- copulaCorrection(LEXP ~ MACHF + COLLHIST + P.Star.MACHF | continuous(MACHF), data= df, optimx.args = list(method=c("Nelder-Mead"),itmax = 60000), num.boots= 10000, verbose = TRUE)
Please provide a data object that contains all the formula's variables.
Error: The above errors were encountered!
Am I missing a step? Do I need to generate the copula, based on the error message "Please provide a data object that contains all the formula's variables". If this is the case, how can I do that?