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?
Please provide a data object that contains all the formula's variables.
Again, a reprex would be helpful with minimal data, because we are now left to guess based on the error message.
The error message seems self explanatory? The formula, LEXP ~ MACHF + COLLHIST + P.Star.MACHF | continuous(MACHF), refers to one or more regressors that are not in your data, df.