The document Test for independence, CSIR-NET Mathematical Sciences Mathematics Notes | EduRev is a part of the Mathematics Course Mathematics for IIT JAM, CSIR NET, UGC NET.

All you need of Mathematics at this link: Mathematics

This lesson explains how to conduct a **chi-square test for independence**. The test is applied when you have two categorical variables from a single population. It is used to determine whether there is a significant association between the two variables.

For example, in an election survey, voters might be classified by gender (male or female) and voting preference (Democrat, Republican, or Independent). We could use a chi-square test for independence to determine whether gender is related to voting preference. The sample problem at the end of the lesson considers this example.

**When to Use Chi-Square Test for Independence**

The test procedure described in this lesson is appropriate when the following conditions are met:

The sampling method is simple random sampling.

The variables under study are each categorical.

If sample data are displayed in a contingency table, the expected frequency count for each cell of the table is at least 5.

This approach consists of four steps: (1) state the hypotheses, (2) formulate an analysis plan, (3) analyze sample data, and (4) interpret results.

**State the Hypotheses**

Suppose that Variable A has r levels, and Variable B has c levels. The null hypothesis states that knowing the level of Variable A does not help you predict the level of Variable B. That is, the variables are independent.

H_{0}: Variable A and Variable B are independent.

H_{a}: Variable A and Variable B are not independent.

The alternative hypothesis is that knowing the level of Variable A can help you predict the level of Variable B.

**Note:** Support for the alternative hypothesis suggests that the variables are related; but the relationship is not necessarily causal, in the sense that one variable "causes" the other.

**Formulate an Analysis Plan**

The analysis plan describes how to use sample data to accept or reject the null hypothesis. The plan should specify the following elements.

Significance level. Often, researchers choose significance levels equal to 0.01, 0.05, or 0.10; but any value between 0 and 1 can be used.

Test method. Use the chi-square test for independence to determine whether there is a significant relationship between two categorical variables.

**Analyze Sample Data**

Using sample data, find the degrees of freedom, expected frequencies, test statistic, and the P-value associated with the test statistic. The approach described in this section is illustrated in the sample problem at the end of this lesson.

**Degrees of freedom.**The degrees of freedom (DF) is equal to:DF = (r - 1) * (c - 1)

where r is the number of levels for one catagorical variable, and c is the number of levels for the other categorical variable.

**Expected frequencies.**The expected frequency counts are computed separately for each level of one categorical variable at each level of the other categorical variable. Compute r * c expected frequencies, according to the following formula.E

_{r,c}= (n_{r}* n_{c}) / nwhere E

_{r,c}is the expected frequency count for level r of Variable A and level c of Variable B, n_{r}is the total number of sample observations at level r of Variable A, n_{c}is the total number of sample observations at level c of Variable B, and n is the total sample size.**Test statistic.**The test statistic is a chi-square random variable (Î§^{2}) defined by the following equation.Î§

^{2}= Î£ [ (O_{r,c}- E_{r,c})^{2}/ E_{r,c}]where O

_{r,c}is the observed frequency count at level r of Variable A and level c of Variable B, and E_{r,c}is the expected frequency count at level r of Variable A and level c of Variable B.**P-value.**The P-value is the probability of observing a sample statistic as extreme as the test statistic. Since the test statistic is a chi-square, use the Chi-Square Distribution Calculator to assess the probability associated with the test statistic. Use the degrees of freedom computed above.

**Interpret Results**

If the sample findings are unlikely, given the null hypothesis, the researcher rejects the null hypothesis. Typically, this involves comparing the P-value to the significance level, and rejecting the null hypothesis when the P-value is less than the significance level.

Offer running on EduRev: __Apply code STAYHOME200__ to get INR 200 off on our premium plan EduRev Infinity!

- Elementary Bayesian inference (Part -1), CSIR-NET Mathematical Sciences
- Elementary Bayesian inference (Part -2), CSIR-NET Mathematical Sciences
- Best linear unbiased estimators, CSIR-NET Mathematical Sciences
- Tests for linear hypotheses, CSIR-NET Mathematical Sciences
- Analysis of variance and covariance, CSIR-NET Mathematical Sciences
- Fixed, random and mixed effects models, CSIR-NET Mathematical Sciences