December 28, 2018

Shiny app overview:

Link to app

In this Shiny app you will be able to generate two sample from a normal distribution, and test their difference in mean via a t-test.

Input panel will looks like this:

In the input panel you will be able to provide:

  1. The sample size of the two distributions
  2. Select the mean of the 1st normal distribution
  3. Select the standard deviation (SD) of the 1st normal distribution
  4. Select the mean of the 2nd normal distribution
  5. Select the standard deviation (SD) of the 2nd normal distribution
  6. Enable or disable the density plot of the two distributions

Output panel will looks like this:

In the output panel you find:

  1. The density plot of the two normal distributions generated
  2. The estimated two sided t-tet statistic
  3. The p-value of the t-test (i.e., probability of incurring in Type I error)
  4. The 1 minus the power of the t-test (i.e., probability of incurring in Type II error)

Why this App?

This Shiny app was developed to showcase how when performing statistical hypothesis testing (e.g., two-sided t-test null hypothesis: different in mean is equal to 0) there are multiple variables that will impact the statistical significance of the results and the power of the analysis (i.e., probability of incurring in Type I and Type II error). Some of these variables are often overlooked. Hence, this app allow users to manipulate some of these variables (i.e., sample size, mean, and standard deviation of two normal distributions) and observed the impact it has on the probability of incurring in Type I and Type II error.

Link to Github Files

How the sample size and the true mean difference affect Type I error?

How the sample size and the standard deviation of the distribution (pooled SD) affect Type I error?

How the sample size and the standard deviation of the distribution (pooled SD) affect Type II error? (For the power test, a delta=1 was used)