Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Dealing With Missing Data in R

Cursus bekijken

Oefeninstructies

  • 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

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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)
Code bewerken en uitvoeren