VIM: Visualization and Imputation of Missing Values

欠損値の可視化と推測

> library(VIM)
Loading required package: colorspace

Attaching package: 'colorspace'
The following object is masked from 'package:raster':

    RGB
Loading required package: data.table
Error: package 'data.table' could not be loaded
> data("SBS5242")
> data("chorizonDL")
> data("sleep")
> data("tao")
> data("testdata")

バージョン: 4.4.1


.
SBS5242 Synthetic subset of the Austrian structural
business statistics data
VIM-package Visualization and Imputation of Missing Values
aggr Aggregations for missing/imputed values
alphablend Alphablending for colors
barMiss Barplot with information about missing/imputed
values
bgmap Backgound map
chorizonDL C-horizon of the Kola data with missing values
colSequence HCL and RGB color sequences
colormapMiss Colored map with information about
missing/imputed values
countInf Count number of infinite or missing values
growdotMiss Growing dot map with information about
missing/imputed values
histMiss Histogram with information about
missing/imputed values
hotdeck Hot-Deck Imputation
initialise Initialization of missing values
irmi Iterative robust model-based imputation (IRMI)
kNN k-Nearest Neighbour Imputation
kola.background Background map for the Kola project data
mapMiss Map with information about missing/imputed
values
marginmatrix Marginplot Matrix
marginplot Scatterplot with additional information in the
margins
matrixplot Matrix plot
mosaicMiss Mosaic plot with information about
missing/imputed values
pairsVIM Scatterplot Matrices
parcoordMiss Parallel coordinate plot with information about
missing/imputed values
pbox Parallel boxplots with information about
missing/imputed values
prepare Transformation and standardization
print.summary.aggr Print method for objects of class summary.aggr
regressionImp Regression Imputation
rugNA Rug representation of missing/imputed values
scattJitt Bivariate jitter plot
scattMiss Scatterplot with information about
missing/imputed values
scattmatrixMiss Scatterplot matrix with information about
missing/imputed values
sleep Mammal sleep data
spineMiss Spineplot with information about
missing/imputed values
tao Tropical Atmosphere Ocean (TAO) project data
testdata Simulated data set for testing purpose
vmGUIenvir Environment for the GUI for Visualization and
Imputation of Missing Values
関数名 概略
SBS5242 Synthetic subset of the Austrian structural business statistics data
VIM-package Visualization and Imputation of Missing Values
aggr Aggregations for missing/imputed values
alphablend Alphablending for colors
barMiss Barplot with information about missing/imputed values
bgmap Backgound map
chorizonDL C-horizon of the Kola data with missing values
colSequence HCL and RGB color sequences
colormapMiss Colored map with information about missing/imputed values
countInf Count number of infinite or missing values
growdotMiss Growing dot map with information about missing/imputed values
histMiss Histogram with information about missing/imputed values
hotdeck Hot-Deck Imputation
initialise Initialization of missing values
irmi Iterative robust model-based imputation (IRMI)
kNN k-Nearest Neighbour Imputation
kola.background Background map for the Kola project data
mapMiss Map with information about missing/imputed values
marginmatrix Marginplot Matrix
marginplot Scatterplot with additional information in the margins
matrixplot Matrix plot
mosaicMiss Mosaic plot with information about missing/imputed values
pairsVIM Scatterplot Matrices
parcoordMiss Parallel coordinate plot with information about missing/imputed values
pbox Parallel boxplots with information about missing/imputed values
prepare Transformation and standardization
print.summary.aggr Print method for objects of class summary.aggr
regressionImp Regression Imputation
rugNA Rug representation of missing/imputed values
scattJitt Bivariate jitter plot
scattMiss Scatterplot with information about missing/imputed values
scattmatrixMiss Scatterplot matrix with information about missing/imputed values
sleep Mammal sleep data
spineMiss Spineplot with information about missing/imputed values
tao Tropical Atmosphere Ocean (TAO) project data
testdata Simulated data set for testing purpose
vmGUIenvir Environment for the GUI for Visualization and Imputation of Missing Values

SBS5242

> data("SBS5242")
> SBS5242 %>% {
+   print(class(.))
+   dim(.)
+ }
Error in eval(expr, envir, enclos): object 'SBS5242' not found

aggr

欠損の可視化

Arguments

  • x... ベクトル、行列、データフレーム
  • delimiter
  • plot
  • col... 一色のみ指定した場合は、その値が欠損ラベルとして利用される
  • bars
  • numbers
  • prop
  • combined
  • varheight
  • only.miss
  • border
  • sortVars
  • sortCombs
  • ylabs
  • axes
  • labels
  • cex.lab
  • cex.axis
  • cex.numbers
  • gap
  • digits
  • object
  • ...
> aggr(sleep)

alphablend

colormapMiss

Arguments

  • col
  • alpha
  • bg
> alphablend(col = "red", alpha = "0")
Error in eval(expr, envir, enclos): could not find function "alphablend"
> alphablend(col = colors()[10], alpha = "0.5")
Error in eval(expr, envir, enclos): could not find function "alphablend"
> alphablend("#FF0000", 0.5)
Error in eval(expr, envir, enclos): could not find function "alphablend"

barMiss

欠損値を棒グラフで可視化

> sleep[, c("Exp", "Sleep")] %>% barMiss()

chorizonDL

> data("chorizonDL")
> chorizonDL %>% {
+   print(class(.))
+   dplyr::tbl_df(.) %>% dplyr::sample_n(., 3)
+ }
Error in eval(expr, envir, enclos): object 'chorizonDL' not found

countInf / countNA

欠損値や無限大の計測

> countNA(sleep$NonD)
Error in eval(expr, envir, enclos): could not find function "countNA"
> sleep %>% dplyr::summarise_each(funs(countNA))
Error in summarise_each_(tbl, funs, lazyeval::lazy_dots(...)): could not find function "funs"

histMiss

Arguments

  • x
  • delimiter
  • pos
  • selection
  • breaks
  • right
  • col
  • border
  • main, sub
  • xlab, ylab
  • axes
  • only.miss
  • miss.labels
  • interactive
  • ...
> tao[, c("Air.Temp", "Humidity")] %>% {
+   print(countNA(.))
+   histMiss(., only.miss = TRUE)
+ }

scattJitt

> tao[, c("Air.Temp", "Humidity")] %>% scattJitt()

scattmatrixMiss

sleep

> data("sleep")
> sleep %>% {
+   print(class(.))
+   print(countNA(.))
+   dplyr::tbl_df(.) %>% dplyr::sample_n(., 4)
+ }
[1] "data.frame"
Error in print(countNA(.)): could not find function "countNA"

spineMiss

欠損値に関するspinogramを描画する

> tao[, c("Air.Temp", "Humidity")] %>% spineMiss()

tao

> data("tao")
> tao %>% {
+   print(class(.))
+   print(countNA(.))
+   dplyr::tbl_df(.) %>% dplyr::sample_n(., 4)
+ }
Error in eval(expr, envir, enclos): object 'tao' not found

testdata

> data("testdata")
> testdata %>% {
+   print(class(.))
+   print(names(.))
+   print(countNA(.))
+   str(., max.level = 2)
+ }
Error in eval(expr, envir, enclos): object 'testdata' not found