Evaluating and comparing imputations
When you build up an imputation model, it's a good idea to compare it to another method. In this lesson, we are going to compare the previously imputed dataset created using impute_lm()
to the mean imputed dataset. Both of these datasets are included in this exercise as ocean_imp_lm_wind
and ocean_imp_mean
respectively.
This exercise is part of the course
Dealing With Missing Data in R
Exercise instructions
- Bind the models together using
bind_rows()
, placing theocean_imp_mean
model intomean
, andocean_imp_lm_wind
intolm_wind
. - Look at the values of
air_temp
andhumidity
as a scatter plot, placingair_temp_c
on the x-axis,humidity
on the y-axis, color by any missings, and faceting by imputation model used (imp_model
).
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Bind the models together
bound_models <- bind_rows(mean = ___,
lm_wind = ___,
.id = "imp_model")
# Inspect the values of air_temp and humidity as a scatter plot
ggplot(___,
aes(x = ___,
y = ___,
color = any_missing)) +
geom_point() +
facet_wrap(~___)