1. Learn
  2. /
  3. Courses
  4. /
  5. Dealing With Missing Data in R

Exercise

Combining and comparing many imputation models

To evaluate the different imputation methods, we need to put them into a single dataframe. Next, you will compare three different approaches to handling missing data using the dataset, oceanbuoys.

  • The first method is using only the completed cases and is loaded as ocean_cc.
  • The second method is imputing values using a linear model with predictions made using wind and is loaded as ocean_imp_lm_wind.

You will create the third imputed dataset, ocean_imp_lm_all, using a linear model and impute the variables sea_temp_c, air_temp_c, and humidity using the variables wind_ew, wind_ns, year, latitude, longitude.

You will then bind all of the datasets together (ocean_cc, ocean_imp_lm_wind, and ocean_imp_lm_all), calling it bound_models.

Instructions

100 XP
  • Create an imputed dataset named ocean_imp_lm_all using a linear model and impute the variables sea_temp_c, air_temp_c, and humidity using the variables wind_ew, wind_ns, year, latitude, longitude.
  • Bind all of the datasets together into the same object, calling it bound_models.