I am trying to get my head around the Chi squared test. Let's say I have collected data on two different days: day A: the weather was good and I sold X ice-creams day B: the weather was bad and I sold Y ice-creams.

I want to understand if I can use the chi-squared test to understand if there is a relation between the weather and the number of ice-cream sold (my null hypothesis would be that there is no statistical significance). If chi squared is not appropriate, what statistical tool should I use?

  • $\begingroup$ Any test will implicitly make an assumption about the distribution of ice-creams sold: your chi-square test that $X+Y$ ice creams were going to be sold on the two days and under the null hypothesis that each one could have been sold on either day. $\endgroup$
    – Henry
    Commented May 2, 2018 at 11:58

1 Answer 1


I would think a t-test would be more suitable statistical test for answering the question whether there are differences in the number of ice-creams sold (your outcome, a continuous variable) in day A compared to day B (your predictor, a binary variable).

You could use the Chi-squared test if your outcome variable was categorical (more than 2 categories, for binary outcome Fisher's exact test is more suitable). Let's say your outcome was the flavour of the ice creams you sold (e.g. vanilla, chocolate, strawberry, etc).

Your null hypothesis would be there is no association between the weather on a given day and the flavour of the ice-creams sold.

  • $\begingroup$ Thanks for this. My understanding is that a t-test compares distributions, and therefore I need multiple data points. Hence, I would need the number of sales on many sunny days and the number of sales on many bad weather days, and then compare the distributions with a t-test to see if there is a statistical significance. Because I have just two data points (one sunny day and one bad weather day) I thought I could treat this problem as two category problem and use a chi-squared test to calculate statistical significance? but probably it doesn't makes sense to do this on just two categories? $\endgroup$
    – DarioB
    Commented May 2, 2018 at 13:44
  • $\begingroup$ There is really little that you can do statistically with two data points. $\endgroup$
    – JMOM1985
    Commented May 3, 2018 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.