Inference – Check data normality

Arrange layout of multigraph

eda.shape <- function(x)
{
        par(mfrow = c(2, 2))
        hist(x)
        boxplot(x)
        iqd <- summary(x)[5] - summary(x)[2]
        plot(density(x, width = 2 * iqd), xlab = "x",
+             ylab = "", type = "l")
        qqnorm(x, pch = 1)
        qqline(x)
        invisible()
}

Transcript

Well, we create a function called eda.shape.  We create a two by two array of plots - one of which is a histogram, a box plot, we calculate the density plot, we compute the qqnorm plot, we add the quartile-quartile line, and off we go.