Sunday, 20 October 2013

Mann Whitney U-test Calculator

The Mann-Whitney U test is a non-parametric test used to determine whether two independent groups of data are different. It is a robust test, and is widely used in many social sciences, including quantitative psychology. For more details, have a look at the following post, or refer to an appropriate textbook on the subject.

As is common with hypothesis testing in general, we start out with a Null Hypothesis, which can be thought of as our default assumption. The Null Hypothesis for the Mann-Whitney U test is that the two groups of data are not different. Based on the U statistic, which is calculated from the data, we determine whether to accept or reject the Null Hypothesis. If we have a large enough number of samples, we can use the calculated p-value as a basis for either accepting or rejecting the Null Hypothesis. The p-value is the probability of obtaining either the observed difference or a more extreme value of the difference between the two groups, purely based on chance. If the p-value is very low (say below a threshold value of 0.05), we reject the Null Hypothesis and the result is considered significant. On the other hand, if the p-value is greater than 0.05, we accept the Null Hypothesis. One should exercise caution when interpreting the result, but a very low value of the p-value could merit further examination of the data, in terms of the possible causes of the significant difference.

Below is an online calculator of the Mann-Whitney U test. Please enter Group 1 and Group 2 values as comma separated numbers in the fields below. Group 1 and Group 2 can have a different number of samples, but there must be at least 5 samples for each of the two groups for the test results to be valid.

Alternatively, you can choose a two-column CSV file to load - simply press on the choose file button below the clear Group 1 and Group 2 buttons. To reload the same file after clearing the text areas, you would need to reload this webpage. Also, the second column of the CSV file can be shorter than the first, so that the rows near the bottom of the CSV file will have only one entry as opposed to two i.e. the smaller dataset must be the second column.

Below there is a graph that will contain a scatter plot of the samples for both groups once the button is pressed to perform the Mann Whitney U test. It is useful to visualise the spread of samples of the two groups. For example, if the samples of the two groups are spaced apart with no overlap, then we would expect the p-value to be very low, or the calculated U statistic to be below the critical value, such that the result is indeed significant.

At the bottom there is a graph that will contain separate histograms for both the groups. It is even more informative to visualise the spread of samples of the two groups in this manner, as it may yield extra information that a researcher would find useful.


Group 1 values: (enter comma separated numbers)
Group 2 values: (enter comma separated numbers)






Results pending...



Scatter plot
values
Group Number

Histograms
Frequency
Values

8 comments:

  1. Good luck to anyone reading this true life story of mine, I Was Diagnosed With type 2 Herpes Virus Last year, And I Was Looking For Solution To Be Cured Luckily I Saw Testimonies On How Dr OYAGU Cure Herpes Virus I Decided To Contact Dr OYAGU I Contacted Him He Prepared A Herbal Medicine Portion And Sent It To Me, I Started The Herbal Medicine For My Health. He Gave Me Step By Step Instructions On How To Apply It, When I Applied It As Instructed, I Was Cured Of This Deadly Herpes Within 2 weeks, I Am Now Herpes Negative. My Brother And Sister I No That There Are So Many People That Have The Same Herpes Virus Please contact Dr OYAGU To Help You Too, And Help Me To Thank Dr OYAGU For Cure Me, I’m Cured By Dr. OYAGU Herbal Medicine, His Contact Email:oyaguherbalhome@gmail.com or visit his website https://oyaguspellcaster.wixsite.com/oyaguherbalhome Or Cell Whatsapp Number +2348101755322 thank you

    ReplyDelete

  2. I was diagnosed with COPD four years ago and struggled with worsening symptoms despite using inhalers and medications. Last year, I tried a herbal treatment from NaturePath Herbal Clinic, and to my surprise, it made a huge difference. My breathing improved, the coughing eased, and my energy came back. I feel better than I have in years. If you're dealing with COPD, I highly recommend checking them out: www.naturepathherbalclinic.com.

    ReplyDelete
  3. EJERCICIO 4
    Sum of ranks for Group 1 is 286, for 16 samples
    Sum of ranks for Group 2 is 120, for 12 samples
    Value of U statistic is 42

    For 5% two-tailed level, Critical value of U (from tables) is 53
    As calculated U < U critical, we reject the Null Hypothesis - i.e. the result is significant

    z score is 2.506887, will be quite inaccurate
    z critical (5%, two-tailed) is 1.959964
    pvalue is 0.012180

    ReplyDelete
  4. EJERCICIO 4:
    La suma de los rangos para el Grupo 1 es 286, para 16 muestras
    La suma de los rangos para el Grupo 2 es 120, para 12 muestras
    El valor de la estadística U es 42

    Para un nivel bilateral del 5%, el valor crítico de U (de las tablas) es 53
    Como U calculado < U crítico, rechazamos la hipótesis nula, es decir, el resultado es significativo

    La puntuación z es 2,506887, será bastante inexacta
    El valor crítico z (5%, bilateral) es 1,959964
    El valor p es 0,012180

    DESICION ESTADÍSTICA:
    Como el valor de significancia estadística de la prueba u de Man Whitney (p = 0.012 180) resultó menor a 0.05,la hipótesis nula se rechaza.
    CONCLUSIÓN:
    Existe diferencia estadísticamente significativa entre la mediana de la excreción urinaria de sodio/potasio en relación a la presencia de la enfermedad, siendo de 319 para el grupo de enfermos y de 121.5 para el grupo de pacientes sanos (p = 0.012 180).

    ReplyDelete
  5. Resultados:
    Sum of ranks for Group 1 is 286, for 16 samples
    Sum of ranks for Group 2 is 120, for 12 samples
    Value of U statistic is 42

    For 5% two-tailed level, Critical value of U (from tables) is 53
    As calculated U < U critical, we reject the Null Hypothesis - i.e. the result is significant

    z score is 2.506887, will be quite inaccurate
    z critical (5%, two-tailed) is 1.959964
    pvalue is 0.012180

    ReplyDelete
  6. Gabriela Aranza Geldres Pinto
    Sum of ranks for Group 1 is 286, for 16 samples
    Sum of ranks for Group 2 is 120, for 12 samples
    Value of U statistic is 42

    For 5% two-tailed level, Critical value of U (from tables) is 53
    As calculated U < U critical, we reject the Null Hypothesis - i.e. the result is significant

    z score is 2.506887, will be quite inaccurate
    z critical (5%, two-tailed) is 1.959964
    pvalue is 0.012180

    ReplyDelete
  7. Sum of ranks for Group 1 is 286, for 16 samples
    Sum of ranks for Group 2 is 120, for 12 samples
    Value of U statistic is 42

    For 5% two-tailed level, Critical value of U (from tables) is 53
    As calculated U < U critical, we reject the Null Hypothesis - i.e. the result is significant

    z score is 2.506887, will be quite inaccurate
    z critical (5%, two-tailed) is 1.959964
    pvalue is 0.012180

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete

Logistic Regression Calculator and ROC Curve Plotter

This blog post implements a Logistic Regression calculator for a binary output. Consider a binary outcome response variable \(Y\...