Graphs

Missing Data (Rough) Notes

Create some missing data Impute missing data Selecting the imputation method manually Analyze (imputed results) Pool results (using Rubin’s rules) Creating nicer output Example Others: Extracting datasets Using Full Information Maximum Likelihood library(mice) #for imputation library(summarytools) #for freq library(dplyr) #other data management dat <- rio::import("http://faculty.missouri.edu/huangf/data/kbbcarVALUE.xls") summary(dat) ## Price Mileage Make Model ## Min. : 8639 Min. : 266 Length:804 Length:804 ## 1st Qu.:14273 1st Qu.:14624 Class :character Class :character ## Median :18025 Median :20914 Mode :character Mode :character ## Mean :21343 Mean :19832 ## 3rd Qu.

Simple Labelled Barchart

Sometimes, a simple side-by-side/comparative bar plot (with labels) is all that is needed to get your point across. For that, Excel can easily plot that in a few seconds with minimum fuss (see figure below). Now replicating that in R seems pretty straightforward. However, several small details require some manual specification. First, let’s provide some data to plot: x <- c(-1, 0, 1) Black <- c(23.6, 21.4, 19.4) White <- c(15.