The University of Hong Kong · FACULTY OF STATISTICS

MEDD8815 Chap.6 Inference for Proportions and Two-Way Tables

- one subject, every graph, every model, every mark
8 Chapters4-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 6 of 8 · MEDD8815

Inference for Proportions and Two-Way Tables

Categorical responses

When the response is yes or no, the statistic is a sample proportion. Session 6 applies the reasoning of Chapter 4 to proportions and then extends it, through the chi-square statistic, to whole tables of counts.

The large-sample procedures rest on the Normal approximation, so each comes with a count condition that must be checked before the arithmetic.

One proportion and two proportions

A confidence interval for one proportion uses the sample proportion in its standard error, while a significance test uses the hypothesised value, because the test is carried out as if the null hypothesis were true.

For two groups the same logic produces an unpooled standard error for the interval and a pooled proportion for the test of equal proportions. The chapter works both on AskSia-authored data and shows how to plan a survey size for a chosen margin of error, taking 0.5 as the safe guess.

Two-way tables and chi-square

A two-way table cross-classifies cases by two categorical variables.

The chi-square test compares each observed count with the count expected if the variables were unrelated, found from the row and column totals, and adds the scaled squared differences. The chapter works a two-by-three table through expected counts, the statistic, its degrees of freedom and the Table F bracket, then follows up by locating the cells that contribute most.

It explains the two sampling designs the same test serves and the count conditions that make it valid.

Links and software

For a two-by-two table the chi-square statistic equals the square of the two-proportion z statistic, so the two-sided tests agree, while only the z test can handle a one-sided alternative.

The SPSS Crosstabs procedure, with Chi-square and Expected counts requested, the Weight Cases step for summarised tables, and the goodness-of-fit dialog are described as the session handout presents them.

In this chapter

What this chapter covers

  • 01

    Sampling distribution of a sample proportion

  • 02

    Confidence interval for one proportion

  • 03

    The z test for one proportion and its count condition

  • 04

    Sample size for a chosen margin of error

  • 05

    Comparing two proportions

  • 06

    Pooled and unpooled standard errors

  • 07

    Expected counts and the chi-square statistic

  • 08

    Degrees of freedom, validity and goodness of fit

Worked example · free

One proportion: interval and test from the same survey

Q [6 marks]. AskSia-authored practice. In a random sample of 250 pupils, 95 say they read for pleasure every week. Give a 95 per cent confidence interval for the population proportion and test whether it differs from 0.45. The marks shown are an AskSia study allocation and are not the University's marking scheme.
Describe before testing.Describe before testing. Compare the conditional distribution of format within each group: secondary teachers lean towards the online course.Preferred development format within each teacher groupPrimary32%41%27%Secondary23%35%42%WorkshopMentoringOnline course
Describe before testing. Compare the conditional distribution of format within each group: secondary teachers lean towards the online course.
  • 2Compute the sample proportion and the standard error for the interval.
  • 2Check the counts and compute the test statistic with the null value.
  • 2Find the two-sided P-value and connect it to the interval.
The sample proportion is 95/250 = 0.38. The interval standard error is the square root of 0.38 x 0.62 / 250, which is 0.0307, so the 95 per cent interval is 0.38 plus or minus 1.96 x 0.0307, giving 0.320 to 0.440. For the test, the expected counts 250 x 0.45 = 112.5 and 137.5 both exceed 10; the null standard error is the square root of 0.45 x 0.55 / 250, which is 0.0315, so z = (0.38 - 0.45)/0.0315 = -2.22. Table A gives 0.0132 below -2.22, so the two-sided P-value is 0.0264. Reject 0.45 at the 5 per cent level, consistent with 0.45 lying just outside the interval.
Sia tip — Two different standard errors appear in one proportion problem: the interval uses p-hat and the test uses p0; write which one you are using before substituting.
Glossary

Key terms

Sample Proportion
The fraction of a sample with a characteristic of interest, the count of successes divided by the sample size, written p-hat.
Pooled Proportion
The combined proportion of successes in two samples, used in the standard error of the test of equal proportions.
Two-Way Table
A table of counts that cross-classifies cases by two categorical variables, one forming the rows and the other the columns.
Expected Count
The count a cell would hold if the two variables were unrelated, equal to its row total times its column total divided by the table total.
Chi-Square Statistic
The sum over all cells of the squared difference between observed and expected counts divided by the expected count.
Goodness of Fit
A chi-square test comparing the observed counts of one categorical variable with the counts expected under hypothesised proportions, with degrees of freedom one less than the number of categories.
FAQ

Inference for Proportions and Two-Way Tables FAQ

When can I use the large-sample procedures for a proportion?

For an interval, the sample should contain at least 10 successes and 10 failures. For a test, the expected numbers under the null value should both be at least 10. When the counts are smaller, the Normal approximation is unreliable and an exact method is needed.

How many degrees of freedom does a chi-square test have?

When a table has r rows and c columns, the degrees of freedom are r minus 1 times c minus 1, so a two-by-three table has 2. For a goodness-of-fit test on k categories they are k minus 1.

What should I report after a significant chi-square test?

Say how the variables are related, not only that they are. Compare the conditional distributions across rows or columns, compare observed with expected counts, and point to the cells with the largest contributions to the statistic; those cells show where the departure from independence lies.

Study strategy

Assessment move

For every proportion problem this week, write two headings before any arithmetic: interval standard error and test standard error, and put the right proportion under each. For every table, compute one expected count by hand and check it against the SPSS Expected row. Those two habits cover the errors this session's homework is built to catch.

Working through Inference for Proportions and Two-Way Tables in MEDD8815? Sia is AskSia’s AI Statistics tutor — ask any MEDD8815 Inference for Proportions and Two-Way Tables question and get a clear, step-by-step explanation grounded in how MEDD8815 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 26 of your The University of Hong Kong subjects - and 1,000+ Bibles across every Australian university.
Sia - your MEDD8815 tutor, unlimited, worked the way the exam marks it
The full 4-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works