Skip to content

Hatchin/Mann-Whitney-U-Test

Repository files navigation

Mann-Whitney Web App

contributions welcome GitHub license


The Mann-Whitney U test is a non-parametric test for testing whether two independent data samples come from the same distribution.

This is a web application for Mann-Whitney U test made with Python and Flask. Add solution to test for small sample size (n < 20).

Table of Contents

  1. Demo

  2. Guide

    1. Data Summary
    2. Test Result
    3. Interpretation
  3. Installation

1. Demo

https://mannwhitney.herokuapp.com/

This First time opening will take few time.

demo

2. Guide

Data Summary

Information summary for two groups of data, including sample size (number of data samples), mean, standard deviation and median for each group.

Test Result

Sig Diff: whether or not the two sample data are from different distribution at the user-defined significant level

Sample Size: if n <= 20, then small sample size; else, large sample size

U-critical or P Value: when small sample size, return the U critical value at the significant level; when large sample size, return the P Value computed from U stat

Sample Stat: U stat computed from the data samples

Effect Size: a value to measure how large the difference is between the two data groups.

Formula:

Larger Group: indicates which group has a higher value

Interpretation

  1. Determine whether or not Sample Size is small
    1. if n <20 ,then Small size;
    2. else, then Large size
  2. Determine whether or not there is significant difference
    1. If sample size is Small, compare U-critical and Sample Stat :
      1. if U-critical > Sample Stat, then there is significant difference (Sig Diff = Yes);
      2. else, there is no signifcant difference (Sig Diff = No), end
    2. If sample size is Large, compare P value and :
      1. if P value < , then there is significant difference (Sig Diff = Yes);
      2. else, there is no signifcant difference (Sig Diff = No), end
  3. If there is significant difference (Sig Diff = Yes), Effect Size will explain how the large the difference is. The larger Effect Sizeis, the huger difference is. Larger Group explicitly indicate the larger group.

3. Installation

This repo contains files for two type of installations, launching a Web Application and Python source code for directly use. You could choose based on your preference.

.   # Web App Files
├── templates               # HTML files for web pages
├── app.py                  # Flask launching file
├── main.py                 # Scripts of extended Mann Whitney Test
    
    # Python source code for directly use
├── mannwhitney.py          # Class of extended Mann Whitney Test
 
    # Basic files
├── requirements.txt         # Required package info
├── LICENSE
└── README.md

3.1 Launch a Web App

Change to app directory, use virtualenv create and activate virtual enviroment.
Then use pip to install requirements:

  pip install -r requirements.txt

Run:

python app.py runserver

Go to http://127.0.0.1:5000/

3.2 Use Source Code directly

Download and import mannwhitney.py.