# For full data using AIC
# First variable of the data set as dependent variable
result <- regression_opt(
data = mantar_dummy_full_cont,
dep_ind = 1,
ic_type = "aic"
)
# View regression coefficients and R-squared
result$regression
result$R2
# For data with missingess using BIC
# Second variable of the data set as dependent variable
# Using individual sample size of the dependent variable and stacked Multiple Imputation
result_mis <- regression_opt(
data = mantar_dummy_mis_cont,
dep_ind = 2,
n_calc = "individual",
missing_handling = "two-step-em",
ic_type = "bic"
)
# View regression coefficients and R-squared
result_mis$regression
result_mis$R2
Run the code above in your browser using DataLab