Central Tendency 

What makes for a good measure of central tendency? What if you are sampling from a skewed or bimodal population? This demo allows you to examine the performance of the mean, median and mode for various populations and various sample sizes. 

RStudio Central Tendency ShinyApp


Central Limit Theorem

Watch the magic of the CLT. Even if the population is not "well behaved" (skewed, bimodal, non-normal in some way), the means of samples drawn from that distribution will converge on a normal distribution as the number of observations per sample increases. Also as the number of observations increases, the standard deviation of the distribution of means decreases in a predictable way. 

RStudio Central Limit Theorem ShinyApp


Power

See how the power to detect an effect changes as a function of the sample size, the complexity of the models being tested, and the size of the "true" effect.

RStudio Power ShinyApp


R code for mcSummary, modelCompare, and 2111_pairwise

The mcSummary code allows you to call mcSummary on an lm object in R. The code was designed to mimic SAS output, with more elaborate statistics for each individual predictor in the model (eta-squared, type 3 SS, confidence intervals, etc.). Feel free to download and source it locally.

For example, if the file were saved in Users/joshuacorrell/: 

source('/Users/joshuacorrell/mcSummaryLm.R') 
model <- lm(y ~ x, data = d) 
mcSummary(model)

You can also source mcSummary from github (this has the advantage that you will have access to the most recent version of the code). You will need to install the devtools package.

library(devtools)
source_url("https://raw.githubusercontent.com/joshuacorrell/teachR/main/mcSummaryLm.R")

Similarly, you can access the modelCompare function from the deceased R package lmSupport, which allows easy comparison of nested models.

And you can access the 2111_pairwise function, which performs pairwise t tests for ANOVA (with or without corrections for multiple comparison)

Use the links below to download the code, or substitute the names of those functions to access them from github.

mcSummary code

modelCompare code

2111_pairwise code