始める無料で始める

ナブラー(nabular)データと欠損状況による可視化

要約統計は有用ですが、「百聞は一見にしかず」とも言いますよね。

この演習では、nabular データを使って、ある変数の欠損状況ごとに別の変数のばらつきを調べる方法を体験します。

ここでは、naniar に含まれる oceanbuoys データセットを使います。

この演習はコースの一部です

Rでの欠損データの扱い方

コースを見る

演習の手順

  • まず vis_miss() を使って、oceanbuoys の欠損構造を確認します。
  • 空気温度の欠損状況ごとに、風の東西成分(wind_ew)の分布を geom_density() で可視化します。
  • 湿度の欠損状況ごとに、海面水温の分布を geom_density() で可視化します。

実践的なインタラクティブ演習

このサンプルコードを完成させて、この演習に挑戦してみましょう。

# First explore the missingness structure of `oceanbuoys` using `vis_miss()`
vis_miss(___)

# Explore the distribution of `wind_ew` for the missingness  
# of `air_temp_c_NA` using  `geom_density()`
bind_shadow(oceanbuoys) %>%
  ggplot(aes(x = ___, 
             color = air_temp_c_NA)) + 
  geom_density()

# Explore the distribution of sea temperature for the  
# missingness of humidity (humidity_NA) using  `geom_density()`
  ___(___) %>%
  ggplot(aes(x = ___,
             color = ___)) + 
  geom_density()
コードを編集して実行