Take the 2-minute tour ×
Biology Stack Exchange is a question and answer site for biology researchers, academics, and students. It's 100% free, no registration required.

I am always so confused whether to do a chi square test or a t test in the sums given by my biostats teacher. Does anyone have a simple rule to decide this?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

This is a very subtle question and I encourage you to read the Wikipedia articles on these different subjects (t-test, chi-squared test, p-value, etc) because the authors worked hard to combat common misconceptions about these commonly used statistical tests. Here is a rather oversimplified rule-of-thumb for these different tests:

  1. t-test: Used when you are looking at the means of different populations. For example, you might want to determine whether the difference in the mean gene expression level between treated and untreated cells is different, or if the gene expression level of cells in a certain environment differs from what you would expect in a null hypothesis. Assumptions: You are assuming that the populations you are looking at are normally distributed. The variance of the populations is not known (that would be a Z-test), but it is assumed that the variance of each population is the same. Finally, for the t-test to work, the samples of the data from the two populations are assumed to be independent.
  2. $\chi^2$ test: Several possibilities for this. The most common in biology is the Pearson $\chi^2$ test, which is used when you are looking at categorical data, like the number of pea plants with white or purple flowers and round or wrinkled seeds, and trying to see whether the number of individuals in each category is consistent with some null hypothesis (such as the number in each category you'd expect if the genes for flower color and seed shape are not linked). Assumptions: The data points were randomly and independently gathered from the population, and you have a reasonably large number of samples.

I'd hate to have made a huge mistake, so please edit my answer and/or contribute your own if you think I am completely misrepresenting these topics!

share|improve this answer
4  
This is correct, though I think the core of it is actually simple. Use chi-square if your predictor and your outcome are both categorical variables (e.g., purple vs. white). Use a t-test if your predictor is categorical and your outcome is continuous (e.g., height, weight, etc). Use correlation or regression if both the predictor and the outcome are continuous. –  octern Nov 14 '13 at 22:57

Additional Info

T-test

As A.Kennard said t-test is applied when the random variable is normally distributed. How to know what is normally distributed is a relevant question. Regular measures which suffer some random error of measurement are normally distributed. The mean values estimated from different samples (the experiment that generates that sample may have any distribution) follow normal distribution. For e.g mean time interval of a radioactive decay- the interval itself is exponentially distributed but the mean of the mean decay interval will be normally distributed. You can reason that it is again an error of measurement that leads to variation in the mean value calculated in different samples. This is called the central limit theorem.

A normal distribution has two parameters- mean and variance i.e. you need to know these values beforehand to construct a normal distribution. A uniform distribution has no parameters- that doesn't mean that uniformly distributed samples have no mean or variance (in this case mean and variance are sample properties not distribution parameters). A t-test or z-test is done to see if a sample is a representative of a given normal distribution. That again means that the calculated mean and variance are equivalent to the corresponding distribution parameters. In case of z-test you know the population variance (distribution parameter). You may ask how can anyone possibly know the population variance beforehand. An example is a case in which you already know the error rate of your measuring device (may be provided by the manufacturer or interpreted from its design).

$\chi^2$ test

There are several variants of the $\chi^2$ test. But what is common between them is that they refer to $\chi^2$ distribution. Variances, which are always positive cannot be a normally distributed. These follow $\chi^2$ distribution. The F-test for variances uses the ratio of the $\chi^2$ statistic of the two random variables denoting variances. Even in the Pearson $\chi^2$ test, the test statistic is a sum of squares which makes it always positive. In fact this $\chi^2$ distribution is also used in t-test. As . Kennard said, one of the assumptions of t-test is that the population variance is unknown but assumed to be equal. Since population variance is unknown it has to be estimated from the sample. Like the case with all estimates you dont have a fixed value but a range of acceptable values falling in some confidence intervals. T-distribution is basically an average of several normal distributions with variance values falling in the allowed confidence interval of a $\chi^2$ distribution.

It is not necessary that categorical data are to be tested by $\chi^2$ test. Coin toss experiment gives rise to a categorical but it can be tested against a binomial distribution. So $\chi^2$ test can be used for categorical data but it is not the only test.

Bottomline: a statistic tested by a $\chi^2$ test has $\chi^2$ distribution as its sampling distribution. That statistic should be a square/sum of squares- something that can never possibly have a negative value. Perhaps that is why it is called $\chi$ squared.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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