CommencerCommencer gratuitement

Evaluating imputations: Across many variables

So far, we have covered ways to look at individual variables or pairs of variables and their imputed values. However, sometimes you want to look at imputations for many variables. To do this, you need to perform some data munging and re-arranging. This lesson covers how to perform this data wrangling, which can get a little bit hairy when considering its usage in nabular data. The function, shadow_long() gets the data into the right shape for these kinds of visualizations.

Cet exercice fait partie du cours

Dealing With Missing Data in R

Afficher le cours

Instructions

  • Use the shadow_long() to gather the imputed data ocean_imp_mean, focussing on humidity and air_temp_c.
  • Print the data and inspect it.
  • Explore the imputations in a histogram using geom_histogram(), placing the values on the x-axis, filling by their missingness and faceting by variable

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Gather the imputed data 
ocean_imp_mean_gather <- shadow_long(___,
                                     ___,
                                     ___))
# Inspect the data
___

# Explore the imputations in a histogram 
ggplot(ocean_imp_mean_gather, 
       aes(x = value, fill = value_NA)) + 
  geom_histogram() + 
  facet_wrap(~variable)
Modifier et exécuter le code