2

I have data grouped into category A and category B.

My hypothesis: the data in category A is closer to zero than category B.

What statistical tests can be used?

Thanks

Tom
  • 21
  • 2
  • When you speak of "the data" being closer to zero: hard to tell whether you are thinking that what could be closer to zero is the mean...the mean of the absolute values...the majority of cases (i.e., if both means are essentially zero, one category could have a smaller standard deviation than the other and thus be more tightly clustered around zero)...and I suppose there are other possibilities. Which matches best? To get the best answer, how about if you post a sample of your data from the 2 groups. – rolando2 Feb 26 '12 at 15:38
  • Appologies.. The data is the angle (degrees) of eye fixation away from a common point. My two categories are male and female. My hypothesis is that males look at this point more than females. Therefore, the male category having very small angles and the female category having larger numbers. – Tom Feb 26 '12 at 17:15
  • Assuming a classical ANOVA model you can use a confidence interval of $\mu_1-\mu_2$. If the interval is above zero then the mean $\mu_1$ is significantly greater than the mean $\mu_2$. – Stéphane Laurent Feb 26 '12 at 17:23
  • You need to better describe your data. For example are all your values positive? By "closer to zero" it is not clear what type of statistic will be most useful to compute. (e.g. means, medians...) – RGF Feb 26 '12 at 15:36

1 Answers1

4

Sounds as if you don't care whether an angle is positive or negative--only how far it is from zero. So you'd want to take the absolute value of each angle before conducting your test. And the natural candidates for that would be a T-test if you have large amounts of data (implying the sampling distributions of the mean absolute values would be approximately normal) and the Mann-Whitney U if you don't. (@Stephane's suggestion of ANOVA amounts to a T-test when you have only 2 groups.)

This R code illustrates the Mann-Whitney procedure.

# Create some data.
set.seed(17)
males <- rnorm(32)
females <- rnorm(32) * 3/2

# The Wilcoxon/Mann-Whitney test on absolute values.
wilcox.test(abs(males), abs(females))

The result in this case is a Wilcoxon statistic of 358 for two groups of 32 observations, giving a p-value of 0.0387: because it is less than a conventional threshold of 0.05, it can be taken as some evidence that the female deviations are greater than the male deviations. To get a better picture of these data, let's look at histograms (red=female, cyan=male):

maleHist <- hist(males, freq=FALSE)
femaleHist <- hist(females, freq=FALSE)
xMin <- min(males, females)
xMax <- max(males, females)
yMax <- max(maleHist$intensities, femaleHist$intensities)
plot(femaleHist, freq=FALSE, xlim=c(xMin, xMax), ylim=c(0, yMax), col=hsv(1, alpha=0.5), main="Histograms", xlab="Angle (degrees)")
lines(maleHist, freq=FALSE, col=hsv(.5, alpha=0.5))

Figure

Evidently, about 32 values in each group are needed to distinguish these sets of deviations, one of which is about 50% greater in size than the other: your power to tell that one group of deviations is closer to zero than the other is not very good.

whuber
  • 281,159
  • 54
  • 637
  • 1,101
rolando2
  • 11,645
  • 1
  • 39
  • 60
  • 1
    @whuber - It is disconcerting to see so much material edited into my answer and thus in effect attributed to me. I don't doubt that your material is correct, but next time you want to add so much, could you please create your own answer. – rolando2 Feb 27 '12 at 04:06
  • http://stats.stackexchange.com/faq#editing (But if you feel the edited material has substantially changed your meaning, please feel free to modify it or roll it back to a previous state: you have that power.) – whuber Feb 27 '12 at 04:36
  • 1
    @rolando2 It looks like whuber nicely illustrated the main point of your reply, without altering any of its original meaning. I generally reject edits that tend to alter one's response even in a slight way (I prefer when the editor leaves this as a comment so that everybody can appreciate the changes, including the author), but edits that enhance clarity and/or provide illustrations should be welcome, IMO. (+1, btw) – chl Feb 27 '12 at 10:28
  • 1
    I find myself sympathetic with rolando2's comment. In way of an explanation, when I came across this question I found that rolando had already offered substantially the same reply I intended to give. Why duplicate the work?, I thought: I don't want to seem to be competing with a perfectly good reply. Making a substantial edit is indeed unusual (although perhaps it should happen more often?), but I hoped it would be seen as a collaborative effort to make a good answer even better and not as an implicit criticism of the original answer. – whuber Feb 27 '12 at 16:24
  • @whuber - I had forgotten about the guidelines at http://stats.stackexchange.com/faq#editing so I guess you are within your rights, so to speak, to do what you did. Maybe it just feels weird because I have never seen this done to others' answers. Thanks for your reply, and to you, chl. – rolando2 Feb 27 '12 at 22:56
  • Within my rights, maybe, but I'm sensitive to people's reactions and don't ever want to upset anyone. The next time I get such an idea I plan to ask permission in comments first, despite SE's official stance that this would merely constitute distracting "noise" :-). – whuber Feb 27 '12 at 23:08
  • 1
    @rolando2 I've done this in the past (e.g., with one of onestop's [answer](http://stats.stackexchange.com/a/4077/930))--otherwise I put my reply as CW. I have no problem with this. As I said, my main concern is when edits might alter the original meaning of the post. I like illustrations a lot; they add a lot of intuitive and insightful perspectives, IMO. I appreciated whuber's initiative because it leads to one unique answer which is sufficient in itself, although I can understand that you may feel embarrassed: no need for that, we are all here to make this site better :-) – chl Feb 27 '12 at 23:26