A Shiny app for inferential statistics by hand

Antoine Soetewey 2020-01-15 3 minute read
A Shiny app for inferential statistics: hypothesis tests and confidence intervals

A Shiny app for inferential statistics: hypothesis tests and confidence intervals

Statistics is divided into four main branches:

  • Descriptive statistics
  • Inferential statistics
  • Predictive analysis
  • Exploratory analysis

Descriptive statistics provide a summary of the data; it helps explaining the data in a concise way without losing too much information. Data can be summarized numerically or graphically. See descriptive statistics by hand or in R to learn more about this branch of statistics.

The branch of predictive analysis aims at predicting a dependent variable based on one or several independent variables. Depending on the type of data to be predicted, it often encompasses methods such as regression or classification.

Exploratory analyses focus on using graphical approaches to delve into the data and identify the relationships that exist between the different variables in the dataset. They are therefore more akin to data visualization.

Inferential statistics uses a random sample of data taken from a population to make inferences, i.e., to draw conclusions about the population (see the difference between population and sample). In other words, information from the sample is used to make generalizations about the parameter of interest in the population. The two major tools in inferential statistics are confidence intervals and hypothesis tests. Here is a Shiny app which helps you to use these two tools:

This Shiny app focuses on confidence intervals and hypothesis tests for:

  • 1 and 2 means (with unpaired and paired samples)
  • 1 and 2 proportions
  • 1 and 2 variances

Here is the entire code in case you would like to enhance it (see an example on how to use this app after the embedded code):

Note that the link may not work if the app has hit the monthly usage limit. Try again later if that is the case.

How to use this app?

Follow these steps:

  1. Open the app via this link
  2. Choose the parameter(s) you want to do inference for (i.e., mean(s), proportion(s) or variance(s))
  3. Write your data in Sample. Observations are separated by a comma and the decimal is a point
  4. Set the null and alternative hypothesis
  5. Select the significance level (most of the time \(\alpha = 0.05\))

In the results panel (on the right side or below depending on the size of your screen), you will see:

  • a recap of your sample together with some appropriate descriptive statistics
  • the confidence interval
  • the hypothesis test
  • the interpretation
  • and an illustration of the hypothesis test

All formulas, steps and computations to arrive at the final results are also provided.

Thanks for reading. I hope you will find this app useful to do inferential statistics and in particular confidence interval and hypothesis testing by hand.

As always, if you have a question or a suggestion related to the topic covered in this article, please add it as a comment so other readers can benefit from the discussion. If you find a mistake or bug, you can inform me by raising an issue on GitHub. For all other requests, you can contact me here.

Get updates every time a new article is published by subscribing to this blog.

Related articles: