Get startedGet started for free

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

View Course

Exercise instructions

  • Bind the models together using bind_rows(), placing the ocean_imp_mean model into mean, and ocean_imp_lm_wind into lm_wind.
  • Look at the values of air_temp and humidity as a scatter plot, placing air_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(~___)
Edit and Run Code