Uncategorized

What is the Mann-Whitney U Test?

April 13th, 2023 by

When you need to compare a numeric outcome for two groups, what analysis do you think of first? Chances are, it’s the independent samples t-test. But that’s not the only, or always, the best option. In many situations, the Mann-Whitney U test is a better option.

The non-parametric Mann-Whitney U test is also called the Mann-Whitney-Wilcoxon test, or the Wilcoxon rank sum test. Non-parametric means that the hypothesis it’s testing is not about the parameter of a particular distribution.

It is part of a subgroup of non-parametric tests that are rank based. That means that the specific values of the outcomes are not important, only their order. In other words, we will be ranking the outcomes.

Like the t-test, this analysis tests whether two independent groups have similar typical outcomes. You can use it with numeric data, but unlike the t-test, it also works with ordinal data. Like the t-test, it is designed for comparisons, and not for estimation or prediction.

The biggest difference from the t-test is that it does not compare means. The Mann-Whitney U test determines whether a random observation from one group tends to be higher (or lower) than a random observation from the other group. Imagine choosing two observations, one from each group, over and over again. This test will determine whether one group is more likely to have the higher values.

It has many advantages: It is a straightforward comparison of means. There are versions for similar and different variances in the two groups. Many people are familiar with it.

(more…)


Teach Statistics Before Calculus? An interesting idea by Arthur Benjamin

January 4th, 2013 by

I don’t usually get into discussions here about the teaching of statistics, as that’s not really the point of this blog.

Even so, I found this idea fascinating, and since this blog is about learning statistics, I thought you may find it interesting as well.

The following is a TED talk by Arthur Benjamin, who is a math professor at Harvey Mudd College.  Let me start by saying he is awesome.  I already watched his Mathemagician TED talk with my kids*, so when I found this, I already expected it to be very good.

I wasn’t disappointed.

*if you too are on an active campaign to instill a love of math in your kids, I highly recommend it.

Here are two of my favorite quotes, keeping in mind that I took calculus in high school and I LOVED it.  Even so, he’s got some really good points:

“Very few people actually use calculus in a conscious, meaningful way in their day-to-day lives.  On the other hand, statistics–that’s a subject that you could, and should, use on a daily basis.”

“If it’s taught properly, it can be a lot of FUN. I mean, probability and statistics–it’s the mathematics of games and gambling, it’s…it’s analyzing trends, it’s predicting the future.”

If you find the video isn’t working, you can watch it directly on the TED site (this is the first time I’ve embedded a video). 🙂

 


 


Adding Statistical Equations to Word using Microsoft Equation Editor

December 16th, 2010 by

Have you ever tried to type a complex fraction, like a logit link, using Word, by lining up two rows of type?

Or a regression model equation?  It’s possible, but it takes forever to subscript all those i’s and change the font of all your B’s to β’s.

I used to, and it’s not easy.

What saved me, years ago, is the Microsoft Equation Editor.

I just mentioned it to a client the other day.  She was thrilled at the ease and flexibility of it, so I thought I’d better share this.

So, to insert a beautiful equation into Word, Powerpoint, or whatever (more…)


Multiple Comparisons in Nonparametric Tests

April 5th, 2010 by

I received received a question about controlling for inflated Type I error through Bonferroni corrections in nonparametric tests.  Here’s the specific question and my quick answer:

My colleague is applying non parametric (Kruskal-Wallis) to check for differences between groups. There are 12 groups and test showed that there is significant difference in the groups. However, to check which pair is significant is tedious and I’m not sure if there is comparable post-hoc test in non-parametric approach. Any resources available in hands?

My answer:

Bonferroni correction is your only option when applying non-parametric statistics (that I’m aware of). Or, actually, any test other than ANOVA.

A Bonferroni correction is actually very simple.  Just take the number of comparisons you want to make, then multiply each p-value by that number.   If the calculated p-value is greater than 1, round to 1.0.

 


Is the mean always greater than the median in a right skewed distribution?

July 3rd, 2009 by

One of the basic tenets of statistics that every student learns in about the second week of intro stats is that in a skewed distribution, the mean is closer to the tail in a skewed distribution.

So in a right skewed distribution (the tail points right on the number line), the mean is higher than the median.

It’s a rule that makes sense, and I have to admit, I never questioned it.

But a great article in the Journal of Statistical Education shows that it really only holds in idealized, unimodal, continuous distributions:  http://jse.amstat.org/v13n2/vonhippel.html.

 


Circular Statistics

December 3rd, 2008 by

Circular variables, which indicate direction or cyclical time, can be of great interest to biologists, geographers, and social scientists. The defining characteristic of circular variables is that the beginning and end of their scales meet. For example, compass direction is often defined with true North at 0 degrees, but it is also at 360 degrees, the other end of the scale. A direction of 5 degrees is much closer to 355 degrees than it is to 40 degrees. Likewise, times that represent cycles, such as times of day (best expressed on a 24 hour clock), day in a reproductive cycle, or month of a year are also circular. January, month 1 is closer to December, month 12, than it is to June, month 6.

Examples of circular variables are abundant in biology, geography, and the social sciences. One experiment I saw in consulting compared the distance and direction flown by male moths in comparison to unmated and mated female moths under different weather conditions.

Other examples include measures of wind and water flow direction to understand the movement of pollutants and the timing of events within a cycle, such as when the number of heart attacks peaks within a week or how body temperature fluctuates over a day. Note that time can be considered either circular or linear. Time is circular when it measures part of a cycle, such as the timing of a daily event. It is linear when it measures length of time, such as the number of days since an event.

Most familiar statistics do not work with circular variables because they assume that variables are linear–the lowest value is farthest from the highest value. For example, the average of 5 degrees, 60 degrees and 340 degrees (which are all northerly directions) is 135 degrees–a southerly direction.  Changing 340 degrees to 20 degrees (an equivalent value) changes the mean to 15 degrees, which is more reasonable. But 5 degrees could also be changed to 365 degrees, giving a mean of 255 degrees, also reasonable. Which is right?

Because classical statistical analysis does not work for circular variables, an entire field of circular statistics has been developed. In circular statistics, each datum is defined by its length and its angle from a chosen point on the circle. In the case of the moths, each moth’s final location would be designated by the distance it traveled from the release point and the angle in degrees from true north. The mean location of all the moths can be found using the sine and cosine of the angle then adjusting for the length. Because the sine of 0 degrees and 360 degrees is the same, this solves the original problem of ends of the scale being near each other.

Circular statistics include tests of uniform direction around the circle, confidence intervals, tests for comparing two groups of directions, circular graphs, correlations, and regression, among others. Although the theory behind these statistics is not new, there have been no mainstream statistical packages that could implement them until recently. Now, both Stata and S-Plus have implemented comprehensive circular statistics modules within the last year.

References: