Talk:Pearson's chi-squared test

message: What is the correct name of this test? I see that you have written "chi-squared test", but in many references I have seen it written as "chi-square test". Which version does Pearson use? And while we are here, should one write p-value or P-value?
: Which version did Pearson use? Simple: he just used the symbol, as far as I have seen. There's a link on his biography page to a site that has a PDF facsimile of his paper from 1900. Maybe it would be useful to link there from here? As for correct name: "chi-squared" and "chi-squared" are used about equally as far as search engine results go. Grotendeels Onschadelijk 03:07, 4 August 2007 (UTC)
thread_title: Correct name

message: I'd like to see some historical perspective. ie, when was it invented? Was this the original chi-squared or is it a development of an earlier one? How heavily is it used (my guess is very heavily) and when did it become a standard statistical method in widespread use? 203.164.221.61 02:55, 30 April 2006 (UTC)
thread_title: Historical perspective

message: I'd understand this topic better coming at it first from the perspective of Fisher's Exact Test, whose justification as a permutation test is intuitively obvious.  I would prefer to then be introduced afterwards to the chi-squared distribution as an approximation which becomes useful when the permutation test becomes intractable.  In other words, I (statistically still fuzzy, like many potential readers) get derailed at the sentence 
If the null hypothesis is true... the test statistic will be drawn from a chi-squared distribution with one degree of freedom.
because I feel I've got to imediately follow that link before I can understand anything else.  If this were postponed till after a discussion of the exact test, I could get the main idea of the
chi-squared test from that and only then move on to worry about the approximation that the chi-squared distribution supplies.
I know that the article presents it as it is conventionally taught; but I've been reading this  Julian Simon book on resampling 
 and becoming increasingly convinced that the conventional presentation is not the best order in which to learn things---since only now am I (generally non-dumbass) finally starting to get this stuff.
Thoughts?
71.127.0.211 16:22, 2 December 2006 (UTC)
replies: text: I rather agree, actually.  That seems like a more intuitive approach. --Gak 20:41, 8 February 2007 (UTC)
thread_title:  Restructuring/Different Emphasis? 

message: I'm posting on this page because it seems to be the most active of the chi square test talk pages and I'm not sure where it belongs.  I added a reduced chi squared statistic to the goodness of fit page, but I don't know if it should have its own page or not.  Is it a subset of the Pearson's chi-squared, or independent?  I'm afraid I don't even have a statistics textbook handy.  --Keflavich 17:17, 9 May 2007 (UTC)
thread_title:  Reduced Chi-squared? 

message: For a while the introduction of this artice has contained the sentence "The events are assumed to be independent and have the same distribution, and the outcomes of each event must be mutually exclusive." I've read this sentence about 100 times, and each time my confidence level has dropped about 1%. At least there is a confusion of terms, because
* by the standard terminology events do not have a distribution, although they have a probability, but it can not be intended that they must have the same probability;
* outcomes are necessarily mutually exclusive, although events may be mutually exclusive if they don't contain the same outcomes.
More seriously, it makes very little sense for events to be independent and mutually exclusive at the same time. For events A and B to be independent, Pr(A and B) = Pr(A)Pr(b) would have to hold. For them  to be mutually exclusive, we would have to have Pr(A and B) = 0. So either Pr(A) or Pr(B) would have to be zero.
As far as I can see, this is a big mistake, and really, I can see no reason why this sentence couldn't be replaced by "The events must be mutually exclusive". (as it used to be) Grotendeels Onschadelijk 03:40, 4 August 2007 (UTC)
thread_title:  Introduction: Incomprehensible sentence 

message: Hi there, I found on the web this assumption for the Chi Square test, is it true? any one got info on the matter:
* Normal distribution of deviations (observed minus expected values) is assumed. Note chi-squared is a nonparametric test in the sense that is does not assume the parameter of normal distribution for the data -- only for the deviations.
Talgalili (talk) 21:46, 29 July 2009 (UTC)
thread_title:  Normal distribution of deviations ??? 

message: Is the formula of the test correct? I see everywhere( even in the definition of wikipedia for the chi-squared distribution) that the denominator E_i should also be squared. Am I wrong? --- 130.237.166.86 (talk) at 16:15, 19 December 2009.
:Yes you are wrong, and both articles are presently correct. Note that the contexts of the two articles are different, but do essentially correspond. In chi-squared distribution, the observations have a normal distibution and the test statistic is composed of the sum squared deviations from the mean, divided by the (known) variance. Here the observations are counts of occurences within categories and the test statistic is composed of the sum squared deviations from the mean, divided by the an approximation for the variance, where the approximation is that the (true) variance is close to the (true) mean, because the counts have an approximate Poisson distribution, and where the sample value is used in substitution of the true mean. Melcombe (talk) 12:34, 21 December 2009 (UTC)
thread_title: December 2009

message: I think there is need to explain what specific sense of "cell" is intended in this article. Is "cell" the same as "category", that is, one of the possible outcomes of an observation? --Ettrig (talk) 13:03, 27 December 2009 (UTC)
thread_title: Cell

message: The example given, testing whether a population has equal numbers of males and females, has only two cells, so the test used employs a chi-squared random variable with only 1 degree of freedom. This is technically valid, but if there are only two cells it's simpler to use a simple proportion test, since the number of males in the sample follows a binomial distribution. The chi-squared test only becomes necessary when there are 3 or more cells, giving a multinomial rather than binomial distribution. I suggest it would be more informative to replace the 2 cell example by a 3 cell example. (Or perhaps to add a new 3 cell example, and add further material to the 2 cell example showing how it it is really only doing a proportion test but in a more complex structure.)
Jim 14159 (talk) 01:14, 26 April 2010 (UTC)
replies: text:  For future reference - I support the idea to add another example here (for something else then a goodness of fit test).Talgalili (talk) 19:59, 22 January 2011 (UTC)
thread_title: 2 Cell Example

message: I used the diagram from chi-squared distribution in Calculating the test-statistic here. However, does anyone have doubt that it is the one to be used here, or finds any errors on what the axis tell? Mikael Häggström (talk) 09:05, 14 June 2010 (UTC)
replies: text: The p-value is not the value on the y-axis of the pdf shown here, it's the tail area, i.e. the area under the curve to the right of the observed value. Equivalently, it's found by subtracting the cdf from 1. Qwfp (talk) 10:17, 14 June 2010 (UTC)
replies: text: Thanks. I've changed it to a new one, showing the inverse of the cumulative distribution function. I hope it fits better. Mikael Häggström (talk) 10:41, 14 June 2010 (UTC)
replies: text: Thanks, that was quick work! Qwfp (talk) 11:37, 14 June 2010 (UTC)
thread_title:  Is the diagram the right one? 

message: In the nomogram at the top, what does the ABCDE stand for? I'd appreciate an explanation in the subtexts. Mikael Häggström (talk) 11:20, 14 June 2010 (UTC)
replies: text: There's some explanation at Nomogram#Chi-squared test computation nomogram. Since pocket calculators came out I can't think of any circumstance when this nomogram would be useful and it's quite hard to explain, so I don't think it's a good lead image. I'd suggest we remove it from this article. Qwfp (talk) 11:42, 14 June 2010 (UTC)
replies: text: I agree and will now remove it. Mikael Häggström (talk) 18:38, 5 August 2011 (UTC)
thread_title:  Insufficient explanation for chi-squared test nomogram 

message: Another comment on the example.  From experience teaching, I think the fact that the value of X^2 in this case is 1 could be very confusing--for example, people might think it's a probability, since that's on a scale of 1, or that the values of X^2 are constrained to integers, or any of a number of other problems.  I suggest changing the numbers to 44 men and 56 women, or something else similar.  (Eliminating confusion is much better than having simple arithmetic, I think.)  I will change it myself in a few days if nobody thinks this is foolish.
Motorneuron (talk) 23:54, 20 July 2010 (UTC)
replies: text: Good point. I agree. Qwfp (talk) 07:19, 21 July 2010 (UTC)

text: I changed it to 44 and 56, which gives X^2 = 1.44 and p = .23, so very little needed changing.Motorneuron (talk) 16:37, 21 July 2010 (UTC)
thread_title: Fact that example X^2 = 1

message: Hi all,
I just added a link to "Cramér's V" but I think this deserves it's own section in this article, or an article of it's own.  What do you think? Talgalili (talk) 22:24, 21 December 2010 (UTC)
replies: text: I modified your link to a direct one. But note that there is more on Cramér's V in contingency table, and possibly elsewhere. Melcombe (talk) 16:48, 22 December 2010 (UTC)
thread_title:  How to mention Cramér's V? 

message: Is it allowed to use the Method of Moments instead of the Maximum Likelihood Method if one uses Pearson's chi-squared test as a goodness-of-fit test?  — Preceding unsigned comment added by 84.83.33.64 (talk) 16:02, 6 July 2011 (UTC)
replies: text: Allowed? Yes, but the consequences, in terms of how good the approximation being used is, would be different. That is, if some form of adjustment were being made to take account of the fact that parameters have been fitted, that adjustment would need to be re-investigated. However I don't think such adjustments are much used in the context of Pearson's chi-squared test as a goodness-of-fit test since, if one were worried about it, then one would be using a better test of fit. Melcombe (talk) 08:52, 7 July 2011 (UTC)
thread_title: Estimation of the Parameters

message: In the paragraph "Assumptions" it is stated, that "The researcher, by using chi square test on small samples, might end up committing a Type II error.". To my understanding, this is not the main-point. I think the bigger problem is that the Type I error is inflated, as can be verified by the following R script (in a 2x2 table with margin distribution (2,2) and (2,2), the probability to commit a Type I error is around 20% for a specified alpha of 5% (which is not acceptable in many cases):
 colSums = c(2,2)
 rowSums = c(2,2)
 prod = (colSums) %*% t(rowSums)
 expected = prod / sum(colSums)
 probs = expected / sum(colSums)
 sim = rmultinom(1000, sum(colSums), probs)
 myP = numeric(ncol(sim))
 falsePositive = 0
 for(i in 1:ncol(sim))
 { 
 	thisP = chisq.test(matrix(sim[,i], nrow = 2))$p.value
 	myP[i] = thisP
         if(thisP < 0.05)
 		falsePositive = falsePositive + 1
 }
 falsePositive / ncol(sim)  — Preceding unsigned comment added by 78.52.192.206 (talk) 09:12, 17 July 2011 (UTC)
thread_title:  Assumptions - Isn't rather Type I error the problem? 

message: The last two paragraphs of the definition are too cumbersome.
# It starts with 'The first step', but only at the very end comes 'A second important part...', as the second step. These steps are also fairly standard and not a characteristic of this particular test. Furthermore, if one is so explicit about the testing steps, the third step of actually comparing the test statistic with the critical value to obtain significance is missing.
# Right after the statistic link there is long talk about ambiguous notations and the distinction between estimated and theoretical values. There is no reason to assume that the reader is confused about this, so all of this is simply distracting. Talk about estimation of statistics should go to the statistic page. Note, moreover, that X2 is used in the Figure, opposite to what is demanded before.
# Fisher's exact test is mentioned at the end of step 1 where it definitely does not belong.
# One should not verbally describe formulas from the subsequent text. Here one can simply mention the formula itself and also normalization.
# The description of the degrees of freedom is incorrect and in conflict with what is described later in the text.
— Preceding unsigned comment added by Muhali (talk • contribs) 18:11, 23 February 2012 (UTC)
replies: text:  Your comment on 'degrees of freedom' is very true and supplements the post about the use of a mere 2-cell (male or female) table as an example: (c-1)*(r-1) computes to 0 degrees of freedom. It should be 1. Medico80 (talk) 13:15, 16 September 2012 (UTC)
thread_title:  Definition 

message: The current article defines the test statistic in terms of "frequencies"  but the current Goodness Of Fit example is phrased in terms of whole numbers of things.  I think the definition of the test statistic is incorrect.  Shouldn't it refer to expected and observed "numbers" of things instead of expected and observed "frequencies" of things?   Many people would interpret "frequency" as implying a ratio.  
Tashiro (talk) 15:54, 19 August 2012 (UTC)
thread_title: Does The Test Statistic Use "Frequencies" Or Whole Numbers? 

message: In "Definition" section there are 3 types discussed. After that I can see sections for test of goodness of fit and test of independence. But I cannot see a section for homogeneity testing. 
Furthermore, I become more confused when in the section for independence testing I find this phrase: "For the test of independence, also known as the test of homogeneity,..." So, at first it says there are 3 types, but below it states that 2 of them are just different names of the same?  — Preceding unsigned comment added by 158.129.156.199 (talk) 10:07, 26 November 2018 (UTC)
thread_title:  3 types of comparison  

message: The very first sentence states that the test can give an indication of "how likely it is that any observed difference between the sets arose by chance," but this is false. The test assumes that there are no differences in observed and expected frequencies and then shows the evidence against that in the form of the chi-squared statistic. To a layman, this may seem like a trivial change in words, but it is not: Absence of evidence is not evidence of absence. The test statistic cannot be interpreted as evidence for its null-hypothesis, this is a common misconception for all NHST. The definition given on the page for chi-squared test (not just Pearson's) is more appropriate, although that one is worded as if there are only chi-squared tests for contingency tables. 86.85.111.83 (talk) 11:50, 9 December 2020 (UTC)
thread_title:  Introduction contains a common misconception 

message: Could the "Fairness of dice" section have errors? Shouldn't the chi-squared value (134) be divided by the Ei value(s), for 13.4, not 134? Shouldn't the "degrees of freedom" be 5, making the values 9.236, 11.070, 12.833, 15.086, and 20.515?
I ran a simulation of 10,000 trials of 60 rolls of a 6-sided dice and the results support using the lower degrees of freedom. The simulation results were:
 90.18% had a chi-squared value ≤ 9.2
 95.10% were ≤ 11.1,
 97.66% were ≤ 12.8,
 99.11% were ≤ 15.1,
 99.90% were ≤ 20.5, and
  0.10% were ≥ 20.6, with a maximum of 27.2.
If this is correct, then I think the concluding paragraph should be re-written to reflect the value of 13.4 is roughly a one-in-a-thousand result, comparable to the chance of rolling twenty 6s mentioned.
ScottRomanowski (talk) 15:17, 14 April 2022 (UTC)
thread_title:  Possible errors in fairness of dice degrees of freedom and sum?