0% found this document useful (0 votes)
3 views

Stats-Chi-square-1

Uploaded by

Bryan Giolaga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Stats-Chi-square-1

Uploaded by

Bryan Giolaga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Chi-square Test for Two

Independent Samples

1
Chi-square Test of Independence

• The chi squared test for independence tests


whether two categorical variables are independent
of one another. The data is often summarized in a
contingency table.
• A contingency table is a two-way frequency table for
categorical data that has at least two rows and two
columns.
• A non-parametric test that is used to measure the association
between two categorical variables.

2
• Chi Square Test for Independence tests the
null hypothesis which states the variables in
the rows and columns are independent of one
another.

Suppose a new postoperative A large furniture retailer with


procedure is administered to a group of stores in three cities had the
patients at a particular hospital. following results from a special
weekend sale.
Chi Squared Test for Independence
• Assumptions for Test of Goodness of Fit
1. Identify the variable and the level of measurement.
2. The data are obtained from a random sample.
3. The expected frequency for each category must be
5 or more.

• The hypotheses are:


• H0: The two variables are independent (no relationship).
• H1: The two variables are dependent (there is a relationship
the two variables).
• If the null hypothesis is rejected, there is some
relationship between the variables.
Contingency Tables – Degrees of Freedom

• The degrees of freedom for any contingency table


are d.f. = (# rows – 1) (# columns – 1)
= (R – 1)(C – 1).
Don’t count the labels or the totals.
Example: Hospitals and Infections
A researcher wishes to see if there is a relationship
between the hospital and the type of patient infections. A
sample of 3 hospitals was selected, and the number of
infections for a specific year has been reported. The data
are shown next.

Degrees of freedom are calculated as:


(#rows – 1) x (# columns – 1)
Do not count labels or totals.
: State the hypotheses and identify the claim.
H0: The type of infection is independent of the hospital.
H1: The type of infection is dependent on the hospital (claim).

: Find the critical value.


The critical value at α = 0.05
d.f. = (# rows – 1) x (# columns – 1)
= (3 – 1)(3 – 1) =(2)(2) = 4
The following slides shows how the
test value for a chi-squared test for
independence is calculated manually.
The example used to demonstrate this
process is the hospitals and
infections example.
Example: Hospitals and Infections

First compute the expected values:


Example: Hospitals and Infections

Observed vs Expected
Example: Hospitals and Infections
Step 3: Compute the test value.
• Make the decision.
The decision is to reject the null hypothesis since
30.698 is in the critical region.

• Summarize the results.

There is enough evidence to support


the claim that the type of infection is
related to the hospital where they
occurred.

You might also like