2

Question 1

Two equally sized patches of the night sky are examined:

  • Patch A contains $100$ stars
  • Patch B contains $110$ stars

Is there a significant difference between these two patches of night sky? i.e., is one patch likely to contain a star cluster?

Question 2

Traffic to a site is examined in two time frames of equal duration

  • in time frame 1 (e.g., summer/June/morning), there were 100 visitors

  • in time frame 2 (e.g., winter/December/evening), there were 110 visitors

Is there a significant difference in site volume between these two time frames? i.e., is demand to the site governed by temporal factors?

Background

I would like to know if there is a statistical test designed to examine whether there is a significant difference between two groups. The values I am evaluating are aggregated counts (so is not a continuous measure or ordinal).

Since the values are aggregated counts, my first instinct was using the Chi-square test of independence. However, I can only find examples where a dichotomy is involved, resulting in a YES/NO, 1-0, TRUE/FALSE contingency table. But in my case, I cannot see an obvious way of representing my data in this dichotomous fashion.

I don't know how to explain this, but is there something like an A/B test, but with only a single row or a single column?

Ben
  • 341
  • 1
  • 8
  • See [significance of difference between two counts](http://stats.stackexchange.com/q/155307/17230). – Scortchi - Reinstate Monica Mar 14 '17 at 12:56
  • @Scortchi - thank you very much for the link, but it seems a bit abstract and general. It would help me tremendously if I could have an explicitly worked solution to my question - i.e., how would I calculate the **p-value** for rejecting the hypothesis that there is no difference between patch A and patch B? In fact - I'll put that in a new question. – Ben Mar 15 '17 at 11:25
  • 1
    The p-value for a one-tailed test is given directly by the binomial distribution function: what's the probability of 100 or fewer "successes" in 210 Bernoulli trials with a common "success" probability of one-half? For two-tailed tests when the distribution of the test statistic under the null is discrete, calculating the p-value can be fiddly, but here the symmetry of that distribution comes to your aid: just double the p-value for the one-tailed test. – Scortchi - Reinstate Monica Mar 15 '17 at 14:00
  • @Scortchi - thanks for sticking with me here. Are you saying that, in the case where the two patches of sky are equal in size, and given my hypothesis that the stars are randomly distributed, then the probability that a given star should lie in either patch is $p=0.5$? Following on from this, if Patch A were twice a big as B, then the probability of 'success' would be $p=2/3$? – Ben Mar 15 '17 at 14:53
  • Yes it's *as if* you started with 210 stars & tossed a coin to decide which patch to put each in. (Or if Patch A were twice as big as Patch B, threw a die & put the star in Patch A if 1 to 4 came up, else Patch B.) But to get to that "*as if*", "randomly" needs to be given a particular interpretation such that the count of stars in each patch follows a Poisson distribution. – Scortchi - Reinstate Monica Mar 15 '17 at 15:51
  • @Scortchi - thanks for the confirmation. I assume this methodology can also be extended to time series data, right? For example, instead of separate snapshots of star count in a solid angle of sky, I might want to look at the number of ants walking across a kitchen tile during time frame A, and then later at time frame B. – Ben Mar 15 '17 at 16:50
  • Yes - but you have to be careful about assumptions. Put a dollop of strawberry jam on the tile over Time Frame A & a dollop of blackberry jam over Time Frame B. You count one ant over Time Frame A; 123 ants over Time Frame B. Sure, you can reject the null, but do you conclude that ants prefer blackberry jam to strawberry? Of course not: you'll always tend to observe either no ants at all, or perhaps a few scouts, or a whole army that have been led to a food source by their sisters. – Scortchi - Reinstate Monica Mar 15 '17 at 17:20

0 Answers0