Memra

Means or proportions, and prop.test

◈ 6 cards

"Percent / fraction / rate of units with an attribute" is a proportion (z); "mean amount per unit" is a mean (t); R’s prop.test prints X-squared = z² and, by default, a continuity-corrected p that is slightly larger than the hand value.

Which parameter is the question about?

The paper never says "this is a proportion question". It describes a business situation, and the wording tells you the parameter:

WordingParameterProcedure
the mean number of errors per invoicet (Modules 9–10)
the percentage of invoices with an errorz (L12.1–12.3)
whether the default rate differs between regionspooled z (L12.4)
whether mean loan size differs between regionsWelch t (Module 11)
the mean change in sales per storepaired t (Module 11)
how the response depends on incomeregression (Module 13)

The tell for a proportion: each unit either has the attribute or does not — an invoice has an error or it does not, a loan defaults or it does not — and the question is about the fraction that do. The data arrive as a count out of . A mean question measures how much of something each unit has — hours, dollars, days — and the data arrive as a list of numbers with an .

The trap is a count that looks like a measurement: the mean number of errors per invoice is a mean (each invoice contributes 0, 1, 2, …), while the proportion of invoices with at least one error is a proportion (each invoice contributes 0 or 1). Same audit, two different questions.

Reading prop.test

R’s one-line tool is prop.test(x, n, p = p0, alternative = …). For Maple Ledger’s test of L12.3:

> prop.test(60, 500, p = 0.1, alternative = "greater")

	1-sample proportions test with continuity correction

data:  60 out of 500, null probability 0.1
X-squared = 2.0056, df = 1, p-value = 0.07836
alternative hypothesis: true p is greater than 0.1

Two things differ from the hand answer (, ). First, R reports X-squared, a chi-square statistic on 1 df, which is simply : the hand . Second, the printed 2.0056 is not 2.22 and the p-value 0.0784 is larger than 0.0681 — because, as the title says, R applies a continuity correction by default (Module 7’s ±0.5 adjustment for approximating a discrete count by a normal curve). Switch it off and the hand answer reappears:

> prop.test(60, 500, p = 0.1, alternative = "greater", correct = FALSE)
X-squared = 2.2222, df = 1, p-value = 0.06802

, the unrounded ; 0.0680 is the hand 0.0681 to the table’s precision. The correction makes the test slightly more conservative; either version is defensible, and the paper expects you to explain the gap, not to reproduce the corrected number by hand.

The two-sample call

Grand River Credit’s two regions, with vectors of successes and sizes:

> prop.test(c(80, 45), c(400, 300), correct = FALSE)
X-squared = 2.9217, df = 1, p-value = 0.08739
95 percent confidence interval:
 -0.006295679  0.106295679

is the hand ; the p-value 0.0874 is the hand 0.0872 with the unrounded ; and the interval is exactly L12.4’s unpooled — R uses separate ’s for the interval and the pooled for the test, as the module did. With the default correct = TRUE the same call prints X-squared = 2.5908, p-value = 0.1075: the correction moves a borderline p, so read the title line before comparing with a hand answer.

The reading checklist

From a prop.test printout: read x out of n and null probability for the setup; take to recover ; read the title for with or without continuity correction — with it, the p exceeds the hand value slightly; note the tail from the alternative hypothesis line; write the decision and the sentence yourself.

NORMAL ~/memra/learn/afm-113/means-or-proportions-and-prop-test utf-8 LF