chi - squared Flashcards

1
Q

What is a contingency table?

A

A table that summarizes data by counting occurrences in different categories of one or more discrete variables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a chi-square (𝜒²) test used for?

A

It is used to compare observed counts to expected counts to determine whether a categorical variable follows a certain distribution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the two types of chi-square tests?

A

Chi-square goodness-of-fit test (for one-way tables)

Chi-square test of independence (for two-way tables)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the null hypothesis (𝐻0) for a chi-square goodness-of-fit test?

A

The observed distribution of a categorical variable matches the expected distribution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the formula for calculating expected frequencies in a chi-square test?

A

Expectedvalue = Totalsamplesize × Expectedproportion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you calculate the chi-square (𝜒²) test statistic?

A

𝜒²stat = sum of [(O - E)² / E]

where 𝑂 is the observed frequency and 𝐸 is the expected frequency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does a large chi-square test statistic indicate?

A

Stronger evidence against the null hypothesis, suggesting that the observed and expected distributions differ significantly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you determine the degrees of freedom (𝑑𝑓) for a chi-square goodness-of-fit test?

A

df=numberofcategories−1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the interpretation of a chi-square test result?

A

If the test statistic is large and falls in the critical region, we reject 𝐻0 and conclude the distributions are significantly different.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the reference chi-square distribution depend on?

A

The degrees of freedom (df), which affects the shape of the distribution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does a very large chi-square test statistic suggest?

A

It suggests a significant difference between observed and expected values, leading to rejection of the null hypothesis.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What command in R is used to perform a chi-square goodness-of-fit test?

A

chisq.test(x=Frequency, p=CensusProp)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you find the expected values in R after performing a chi-square test?

A

salsusTest$expected

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What R function provides the critical value for a chi-square test at a 5% significance level?

A

qchisq(p=0.05, df=4, lower.tail=FALSE)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the purpose of a chi-square test of independence?

A

To determine whether two categorical variables (e.g., gender and political support) are independent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the null and alternative hypotheses in a chi-square test of independence?

A

H0: The two categorical variables are independent.

𝐻1 : The two categorical variables are not independent (i.e., there is an association).

17
Q

How do you calculate expected values in a chi-square test of independence?

A

Expectedvalue = (Rowtotal×Columntotal)/ grand total

18
Q

How do you calculate degrees of freedom for a chi-square test of independence?

A

df=(numberofrows−1)×(numberofcolumns−1)

19
Q

How do you structure data for a chi-square test of independence in R?

A

Convert the data into a matrix using:
voters.mat <- matrix(voters, nrow=2, ncol=3, byrow=TRUE)

20
Q

What R function is used to perform a chi-square test of independence?

A

chisq.test(x=voters.mat)

21
Q

Why is a correction applied by default for 2 × 2 tables in the R chisq.test() function?

A

To account for the approximation of a discrete distribution by a continuous 𝜒2 distribution, making the test statistic smaller and the p-value larger.

22
Q

What are the key assumptions for a valid chi-square test?

A

Data must be from a random sample.

Each expected cell count should be greater than 1.

At least 80% of expected counts should be 5 or more.

23
Q

What can be done if the chi-square test assumptions are violated due to small sample sizes?

A

Combine categories in a sensible way to increase expected cell counts.

24
Q

What are the two main types of chi-square tests?

A

Chi-square goodness-of-fit test – Checks if observed data fit a known distribution.

Chi-square test of independence – Checks if two categorical variables are associated.

25
Q

What is the general approach to hypothesis testing, including chi-square tests?

A

State the null and alternative hypotheses.

Calculate the test statistic.

Compare the test statistic to a reference distribution.

Draw conclusions based on the p-value.