Missing value analysis in R using multiple imputation

preview_player
Показать описание
Teach one for HAP719 in GMU. Missing data analysis in R STUDIO .
Рекомендации по теме
Комментарии
Автор

Please add the Rsquared this after
# Fit a logistic regression model
model <- glm(bs1lr_binary ~ bs2lr_binary + bs3lr_binary + bs4lr_binary + bs5lr_binary + bs6lr_binary + bs7lr_binary + bs8lr_binary + bs9lr_binary + bs10lr_binary + bs11lr_binary + bs12lr_binary + bs13lr_binary + bs14lr_binary + bs15lr_binary + bs16lr_binary + bs17lr_binary + bs18lr_binary + bs19lr_binary, data = df_sample, family = binomial)

# Calculate the McFadden R-squared
L_m <- logLik(model)
# Fit the null model and calculate its likelihood
null_model<- glm(bs1lr_binary ~ 1, data = df_sample, family = "binomial")
L_0 <- logLik(null_model)

# Calculate the McFadden R-squared
R2_McFadden_postsampling <- 1 - (L_m / L_0)
cat("McFadden R-Squared Post-sampling:", R2_McFadden_postsampling)

ledothankachan