STAT5002 Cheatsheet · Introduction to Statistics

University of Sydney · Cheatsheet for the final exam. Semester 2 formal examination period, from 16 November 2026 (the Exams Office publishes the exact date). Full STAT5002 study guide →

A4 landscape · 7pt body · 6 columns · revision-first2 sides · STAT5002 · USyd
STAT5002
Introduction to Statistics
University of Sydney · postgraduate · Semester 2, 2026
STAT5002 cheatsheet QR code – open the full STAT5002 study guide
Full guide + ask Sia about STAT5002
EXAM REVISION SHEET · SIDE 1/2
SIDE 1/2   DEFINITIONS → FORMULAS → DECISIONS → CHECKSFINAL EXAM 60% · 2 HOURS · AI PROHIBITEDS2 2026 · course.json
Final Exam 60%Quiz 20%Assignment 10%Weekly Online quizzes 10%
Final Exam 60% · Quiz 20% · Assignment 10% · Weekly Online quizzes 10%. Permitted materials: not confirmed for this offering in the course materials we hold — check the exam instructions on the LMS. [BRIEF.md; course.json]

1 · Start with the VariableCh 1 · IDA

VARIABLEQUALITATIVEQUANTITATIVEORD.NOM.DISC.CONT.factornumericbarplothist / boxplot
Classify the variable first; that determines the R storage check and the useful plot.
VariablesFast display
1 qualitativebarplot(table(x))
2 qualitativestacked / beside bars
1 quantitativehistogram, boxplot
2 quantitativescatter plot
quantitative by groupboxplot(y ~ group)

Qualitative: nominal or ordered. Quantitative: counted (discrete) or measured (continuous). A numerical code can still be qualitative; inspect str(), then use as.factor() or as.numeric(). Replace missing-value codes by NA.

Unequal histogram intervalsarea = count ÷ total
height = area ÷ interval width
count = height × width × total

Area carries proportion; height carries crowding. With right=F, intervals include the left edge and exclude the right. Conditions act elementwise: ==, !=, &, |, !; sum(condition) counts TRUE values.

First-look sequence: establish the data source and research question → inspect dimensions and one row per subject → classify columns → repair storage and missing codes → select plots and numerical summaries → look for impossible values, outliers, skew and group differences. An anonymous ID is not an analysis variable.

R patternMeaning
table(x); barplot(...)counts for a qualitative variable
hist(x, breaks=..., right=F)left-closed classes
boxplot(y ~ group)quantitative response across groups
sum(x>5 & x<=10)count values in (5,10]
d[d$x>5 & d$g=="A", ]filter matching rows

Trap + fix Digits do not make an ID quantitative: if averaging is meaningless, treat it as qualitative and use as.factor(). With right=F, a boundary enters the interval starting there; predict its bin first.

3 · Normal Curve: Area or Cut-off?Ch 3

NORMAL CDFqnorm(.90)=25.69pnorm(12)=.158701836
pnorm maps a cut-off to lower-tail area; qnorm maps lower-tail area back to a cut-off.

X ~ N(μ, σ²) · z=(x−μ)/σ
P(X<a)=pnorm(a, μ, σ)
P(X>a)=pnorm(a, μ, σ, lower.tail=F)
P(a<X<b)=pnorm(b,μ,σ)−pnorm(a,μ,σ)
Qₚ=qnorm(p, μ, σ)=μ+σqnorm(p)

Second entry of N(μ,σ²) is variance; pnorm/qnorm expect SD. Total area = 1. Symmetry: P(Z<−a)=P(Z>a). The 68–95–99.7 rule places about 68%, 95%, 99.7% within 1, 2, 3 SDs.

Question givesQuestion asksUse
measurementproportion / chancepnorm
proportionmeasurement / cut-offqnorm
Band / percentileNormal shortcut
μ±σabout 68% inside; 16% in each tail
μ±2σabout 95% inside; 2.5% each tail
μ±3σabout 99.7% inside; 0.15% each tail
16th, 50th, 84thapproximately μ−σ, μ, μ+σ

Sketch before code: mark μ, the cut-off(s), and shade. One pnorm call returns one lower tail; an upper tail uses the complement, an interval subtracts two lower tails, and two outer tails must be added. For a standardised calculation, the area is unchanged when x becomes z.

4 · Correlation: Calculate, Then DistrustCh 4

r = average(zₓzᵧ), −1≤r≤1 · cor(x,y)

Plot first. r measures only straight-line association. Its sign must match the visible slope. Adding a constant, multiplying by a positive constant, or swapping x/y leaves r unchanged; multiplying one variable by a negative constant flips its sign.

TrapConsequence
one outliercan dominate r
curved relationr can be 0 despite exact dependence
group averagesecological r tends to inflate
associationdoes not establish causation

5 · Regression: Five Numbers → LineCh 5

Predict y from xb = r·SDᵧ/SDₓ · a = ȳ−b x̄ · ŷ = a + bx
e=y−ŷ · SSE=Σe² · SST=Σ(y−ȳ)²
R²=1−SSE/SST=r²

The line passes through (x̄,ȳ), minimises squared residuals, and moves only r SDs in y for each SD in x. Baseline prediction is always ȳ. Do not rearrange the y-on-x line to predict x; refit lm(x ~ y).

EVEN BANDFANSD ≈ 10SD: 2.9 → 17.2constant spreadspread grows
An even residual band supports prediction; a fan shows changing spread and warns against it.
Residual plotDecision
random band around 0; equal strip spreadslinear fit, homoscedastic; prediction defensible
curveline misses shape
fan / changing strip spreadheteroscedastic; do not trust prediction

Check Residuals from the fitted line average zero. Positive residual = observed point above the line. R² is the share of y-variation removed relative to predicting ȳ.

R output decoder

Object / quantityRead as
lm(y ~ x)response first; predictor after ~
coef: (Intercept)a, fitted y when x=0
coef: xb, change in fitted y per x unit
fitted.valuesŷᵢ on the line
residualsyᵢ−ŷᵢ
cor(x,y)^2R² for simple linear regression

Reverse prediction: y-on-x slope is rSDᵧ/SDₓ; x-on-y slope is rSDₓ/SDᵧ. Rearranging the first gives SDₓ/(rSDᵧ), which is different unless |r|=1. Extrapolation beyond the observed x-range also lacks data support.

12 · Chi-squaredCh 12

T=Σ(O−E)²/E · P=pchisq(T,df,lower.tail=F)
GOF: Eⱼ=np₀ⱼ, df=k−1
independence: Eᵢⱼ=rowᵢ total×colⱼ total/n
df=(r−1)(c−1)

5b · Regression Answer Pathmarks

  1. Name response y and predictor x.
  2. Compute b; its sign must equal r.
  3. Compute a from the point of averages.
  4. Substitute x; retain units.
  5. Residual = observed − fitted; interpret sign.
  6. Square r; write “% of variation in y explained”.
  7. Inspect residual pattern before endorsing prediction.

SSE versus SST: SST is the squared error from always predicting ȳ; SSE remains after using x. Thus 1−SSE/SST is improvement over the baseline. A large R² does not repair curvature, unequal spread, an influential point or a causal interpretation.

6 · Probability RulesCh 6

POSTGRADUNDERGRADjoint = .06joint = .18P(late|P)=.15P(late|U)=.30P(late)=.24P(P|late)=.25
Conditional probabilities are column heights; joint probabilities are the corresponding areas.

P(Aᶜ)=1−P(A)
P(A|B)=P(A∩B)/P(B)
P(A∩B)=P(A)P(B|A)
P(A∪B)=P(A)+P(B)−P(A∩B)

ConditionMeaningShortcut
mutually exclusivecannot both occurP(A∩B)=0
independentone does not change the otherP(A∩B)=P(A)P(B)

Exclusive positive-probability events are dependent. For “at least one”, use 1 − P(none). Before multiplying, write the second chance as “given”; drop the condition only after independence is established.

sample(..., replace=FALSE) changes the box after each draw; draws are dependent. Use set.seed() for reproducibility, put one experiment in a function, repeat with replicate(), and take mean() of logical results.

Set language: A∩B means both; A∪B means at least one; Aᶜ means not A. Conditional probability restricts the denominator to B. Independence can be checked by P(A|B)=P(A) or P(A∩B)=P(A)P(B); one equality failure is enough to reject it.

PromptFirst move
at least one success1−P(no successes)

8 · Law of Averages + CLTCh 8

COUNT SE ↑ · PROP. SE ↓√(npq): 1.6 → 158.1√(pq/n): 15.81% → .16%n: 10 → 100,000
As n grows, count SE rises as √n while proportion SE falls as 1/√n.

The sample average concentrates at μ because σ/√n→0. The sum's absolute error grows as σ√n; the proportion's error shrinks as σ/√n. The original ticket box does not become normal: the distribution of sums or averages does.

CLT for a sumz=(s−nμ)/(σ√n)
P(S≤s) ≈ pnorm(s, nμ, σ√n)

Approximation quality depends on box shape: a very skewed box needs more draws. Always identify sum versus average, write E and SE, then sketch the requested tail before calling pnorm.

Kerrich check: for 10,000 fair tosses, E(heads)=5,000 and SE(count)=0.5√10,000=50. The observed 5,067 is +67, or 1.34 SEs, from expectation. The count error is visibly large, but the proportion error is only 0.0067.

Multiply n by 10Effect
SE of count×√10 ≈ ×3.16
SE of proportion / average÷√10 ≈ ÷3.16
shape of sumsusually closer to normal

9 · One Proportion: Interval + ZCh 9

p̂=x/n · SE(p̂|p)=√[p(1−p)/n]
prediction interval (known p): p ± 1.96SE
Wilson CI: binom.confint(x,n,method="wilson")
z=(p̂−p₀)/√[p₀(1−p₀)/n]

H₁P-value
p<p₀pnorm(z)
p>p₀pnorm(z, lower.tail=F)
p≠p₀2×pnorm(|z|, lower.tail=F)

Wilson collects candidate p values whose prediction intervals contain p̂; because SE depends on p, it is not centred exactly on p̂. A 95% procedure captures the true p in 95% of repeated samples, not a 95% probability statement about this fixed interval.

10 · HATPC: Write the Whole TestCh 9–12

  1. Hypotheses: parameter and direction fixed before data.
  2. Assumptions: random / independent draws; distribution or large-sample condition; study design.
  3. Test statistic: estimate minus null, divided by null SE.
  4. P-value: assuming H₀, chance of evidence at least this strong in H₁'s direction.
  5. Conclusion: compare with α; reject or do not reject H₀; answer in context.

A large P-value does not prove or “accept” H₀. A two-sided level-α test and a (1−α) CI give the same decision about the null value.

z = 2.26H₁: p>.04H₁: p<.04H₁: p≠.04P=.0119P=.9881P=.0239reject 5%not rejectreject 5%tail follows H₁
The same z gives different P-values: choose the tail from H₁ before reading the data.

Tail logic: the statistic measures distance from H₀ in SEs. “Less” uses a lower tail; “greater” an upper tail; “different” both. The P-value is computed under H₀ and is not the probability that H₀ is true. α is the long-run false-alarm probability when H₀ is true.

11 · Choose the Mean TestCh 10–11

Design / informationStatistic / R
one mean; σ knownZ=(x̄−μ₀)/(σ₀/√n)
one mean; σ unknown; near normalT=(x̄−μ₀)/(s/√n), df=n−1; t.test(x,mu=)
2 independent; unequal spreadsWelch: t.test(x,y) default
2 independent; common SD justifiedpooled: var.equal=T; df=m+n−2
same units twice / matcheddifferences d=x−y; paired=T; df=n−1
clear skew / doubtful normalitybootstrap T from centred surrogate box

Two independent meansSE(x̄−ȳ)=√(σₓ²/m+σᵧ²/n)
pooled sₚ=√([(m−1)sₓ²+(n−1)sᵧ²]/(m+n−2))
T=(x̄−ȳ)/[sₚ√(1/m+1/n)]

Student's t has fatter tails than N(0,1); use pt/qt, not pnorm/qnorm. QQ points near a line support a near-normal box. For paired data, argument order fixes difference sign.

https://www.asksia.ai/cheatsheet/usyd-stat5002 · Full STAT5002 study guide → · side 1/2
Shared by ________
Forward this to your tutorial groupv2 · 2026-10-25
Semester 2 formal examination period, from 16 November 2026 (the Exams Office publishes the exact date).
Check your exam instructions on the LMS for what you may bring; use this sheet to revise and self-test.
STAT5002
Introduction to Statistics
University of Sydney · postgraduate · Semester 2, 2026
STAT5002 cheatsheet QR code – open the full STAT5002 study guide
Full guide + ask Sia about STAT5002
EXAM REVISION SHEET · SIDE 2/2
SIDE 2/2   SELF-TEST DRILLS · ANSWER PATHS · JUDGEMENT CARDS · CLASSIC TRAPSCOVER → SOLVE → CHECKWorked values from source/chapters.json

D1 · Summaries DrillCh 1–2 worked

200 parcels: intervals [0,1), [1,2), [2,5), [5,15); counts 40, 50, 80, 30.

IntervalAreaWidthHeight/kg
[0,1)0.2010.200
[1,2)0.2510.250
[2,5)0.4030.1333
[5,15)0.15100.015
12 · .1528 · .3530 · .37510 · .1250204090
Density histogram: area is proportion; height is proportion divided by interval width.

Answer path: areas add to 1. Most crowded = [1,2), tallest at 0.25/kg. Most parcels = [2,5), area 0.40. At least 2 kg = 0.40+0.15=0.55.

Trap Comparing heights answers “most crowded”, not “most subjects”; recover area as height × width.

Centre-and-spread checkpoint

Fares: 9, 11, 12, 12, 14, 15, 17, 30. x̄=120/8=15; median=(12+14)/2=13. Σ(x−15)²=300, so s=√(300/7)=6.547. z for 30=(30−15)/6.547=2.29.

IQR=15.5−11.75=3.75; UT=15.5+1.5(3.75)=21.125; 30 is an outlier. Mean>median and a right tail → report median 13, IQR 3.75.

Self-checkRequired statement
Σ deviationsmust be 0
sample variance300/7, not 300/8
z=2.2930 is 2.29 SDs above mean
30>UTflagged by 1.5IQR rule
right-skewedprefer median + IQR

Reverse checks: data point = mean + SD×z, so 15+6.547(2.29)≈30. The lower threshold is 11.75−1.5(3.75)=6.125, so there is no low outlier. A flagged outlier is not automatically an error; investigate it before removal.

Normal-area checkpoint

Bolt lengths follow N(40,0.5²) mm; reject below 39.2 or above 40.8. Limits standardise to −1.60 and +1.60. Each tail is 0.0548 by symmetry, so rejection probability is 0.0548+0.0548=0.1096, about 11.0%.

pnorm(39.2,40,0.5) + pnorm(40.8,40,0.5,lower.tail=F)
= pnorm(−1.6) + pnorm(1.6,lower.tail=F)

D2 · Regression DrillCh 5 worked

Sleep x: x̄=6.8 h, SDₓ=1.1. Reaction y: ȳ=312 ms, SDᵧ=28. r=−0.55.

  1. b=−0.55×28/1.1=−14.0 ms/h.
  2. a=312−(−14)(6.8)=407.2.
  3. Line: ŷ=407.2−14x.
  4. x=5.5 → ŷ=407.2−77=330.2 ms.
  5. R²=(−0.55)²=0.3025 → about 30% of reaction-time variation explained.
  6. Observed y=340 → e=340−330.2=+9.8 ms: slower than predicted; point lies above line.
SD LINE vs REGRESSIONSD slope 2.06reg: 1.41(28.1, 64.0)temperature →
Both lines pass through the point of averages; regression slope is r times the SD-line slope.

Check Slope sign matches r; line passes through (6.8,312); residual uses observed minus fitted; R² loses r's sign.

Standard-unit audit: 5.5 h is (5.5−6.8)/1.1=−1.18 SDs from mean sleep. A regression prediction moves r times that many response SDs: (−0.55)(−1.18)=+0.65 SDs, or about 0.65×28=18.2 ms above 312 → 330.2 ms. This catches a swapped SD ratio.

Meaning of 30%: the line removes 30.25% of SST relative to the baseline ȳ=312; about 69.75% remains in residual variation. It does not mean 30% of people lie on the line, nor that sleep causes reaction time.

Judgement · Regressionif X → Y

If you see…Do…
predict x from yrefit lm(x ~ y)
curved scatterdo not summarise by r alone
fan residualsflag heteroscedasticity; distrust prediction
one distant pointcheck influence on r and line

Also check the prediction lies within the observed x range. A good numerical fit can still be unsafe when extrapolating. A residual plot must show both random shape and roughly equal vertical spread; averaging residuals to zero is automatic and does not prove adequacy.

Correlation arithmetic checkpoint

D3 · One-Proportion Z DrillCh 9 worked

Clinic claim p₀=0.70; suspicion p<0.70. Random n=90 visits; x=54, so p̂=0.600. Test at α=0.05.

HATPCH₀:p=0.70 · H₁:p<0.70
SE₀=√(0.7×0.3/90)=0.0483
z=(0.600−0.700)/0.0483=−2.070
P=pnorm(−2.070)=0.0192

z = 2.26H₁: p>.04H₁: p<.04H₁: p≠.04P=.0119P=.9881P=.0239reject 5%not rejectreject 5%tail follows H₁
The same z gives different P-values: choose the tail from H₁ before reading the data.

Conclusion: 0.0192<0.05 → reject H₀. The data are evidence that fewer than 70% of patients are seen within 15 minutes.

Trap The null value p₀ belongs in the test SE. H₁ fixes the lower tail before the data are seen.

Assumption line: the 90 visits are treated as random independent draws from a large population of visits; under H₀ the expected successes and failures are 63 and 27, so the normal approximation is reasonable. Name the population parameter before arithmetic.

Decision cross-check: a negative z supports only a lower alternative. If the question had asked “different”, the two-sided P-value would be 2×0.0192=0.0384; if it had asked “greater”, the upper-tail value would be large. Same data, different pre-specified question.

Fast Tail DecoderCh 3, 8–10

PhraseShade / R pattern
below, less, shorterleft tail; pnorm(z) / pt(t,df)
above, greater, longerright tail; lower.tail=F
different, either directiontwo tails; double matching tail
between a and blower tail at b minus lower tail at a
outside limitsadd two separate tails

Never choose the tail from the observed sign. Choose from the research question and H₁.

Interval and test are not interchangeable inputs

D4 · Mean-Inference DrillsCh 10–11 worked

Commute: n=16, x̄=27.9 min, s=4.4 min; test μ>25. QQ plot roughly straight.

H₀:μ=25 · H₁:μ>25
SE=s/√n=4.4/4=1.1
t=(27.9−25)/1.1=2.636 · df=15
P=pt(2.636,15,lower.tail=F)=0.0093

t₃ HAS FATTER TAILSnormal: .050t₃: .145cut ±1.96t critical=3.18
Student's t has fatter tails: using pnorm for a small-sample T-statistic understates the P-value.

0.0093<0.05 → reject H₀; evidence mean commute exceeds 25 min. For a 95% CI, qt(0.975,15)=2.131:

27.9 ± 2.131×1.1 = (25.56, 30.24) min

Trap Because σ is estimated by s, use t with n−1 df. A one-sided test still pairs here with the supplied two-sided 95% interval.

Output route: t.test(x, mu=25, alternative="greater") should report t≈2.636, df=15 and the one-sided P-value. The ordinary 95% two-sided interval uses qt(0.975,15); qt, not qnorm, supplies the multiplier because s is estimated.

CI logic: the null value 25 lies below (25.56,30.24), consistent with rejection by a two-sided 5% test. The one-sided P-value is smaller because only the upper tail counts. Always state minutes on the endpoints and the population mean being estimated.

Mean-Test Judgement CardsCh 10–11

If you see…Do…
population σ knownZ-test; normal critical value
σ estimated, one sampleone-sample T; df=n−1
2 independent groups; spreads differWelch default
same person/item twicepaired: test differences
skewed small samplebootstrap T logic

Bootstrap: use sample as surrogate box; resample; store T-statistics. If lower/upper T quantiles are ℓ,u, equal-tailed CI is [x̄−uSE, x̄−ℓSE]; skew can make it lopsided.

R functionWhat it returns
pt(t,df)lower-tail t area
qt(p,df)t cut-off with p below
t.test(x,mu=)one-sample test + CI
qqnorm(x); qqline(x)visual normality check

Paired-Design Branchinside D4 · Ch 11

Ten baristas use old and new machines. Differences old−new: 3, 3, 1, 5, 1, 5, 1, 3, 4, 1.

d̄=2.70 s · s_d=1.636 · SE=1.636/√10=0.517
T=2.70/0.517=5.218 · df=9
P=2×pt(5.218,9,lower.tail=F)=0.0006
CI=2.70±2.262×0.517=(1.53,3.87) s

8 TYPISTS: TEST DIFFERENCESLayout ALayout BB−Amean=3.25
Pairing removes between-person spread and tests the within-person differences.

Reject H₀: mean difference 0. Because old−new is positive, the new machine is faster by about 2.7 s on average.

Trap The unpaired method counts barista-to-barista variation as noise. Write differences first; swapping x,y flips the sign and reverses a one-sided alternative.

Assumptions attach to differences: the ten baristas are the independent units; the distribution to inspect is the ten old−new differences, not the two raw columns separately. A dot plot shows no extreme outlier, so a one-sample T procedure on d is the intended model.

Interval conclusion: every plausible old−new mean in (1.53,3.87) is positive, so the new machine is faster. For t.test(old,new,paired=T), R subtracts first argument minus second; reverse them and the interval becomes negative.

Independent Two-Sample ChecklistCh 11

  1. Confirm units in group X are independent of units in Y.
  2. State parameter μₓ−μᵧ and argument order.
  3. Inspect boxplots / spreads and distribution shape.
  4. Use Welch by default; pool only if common SD is justified.
  5. Read Welch's fractional df from R; do not force m+n−2.
  6. For one-sided work, set alternative= to match the written H₁.

Classical / Welch / paired separator

D5 · Chi-squared Independence DrillCh 12 worked

YearR dailyNot dailyTotal
First184260
Second304070
Third+373370
Total85115200
OBSERVED vs EXPECTEDOE(H₀)C-WC-BC-CH-WH-BH-C
Expected cell counts come from row total × column total ÷ grand total.

H₀: year and daily R use independent. Expected counts: First 25.50,34.50; Second 29.75,40.25; Third+ 29.75,40.25. All exceed 5.

terms: 2.206+1.630+0.002+0.002+1.767+1.306
T=6.913 · df=(3−1)(2−1)=2
P=pchisq(6.913,2,lower.tail=F)=0.0315

0.0315<0.05 → reject H₀: evidence daily R use depends on year level; first-year daily use is lower than expected.

Arithmetic audit: expected rows sum to 60, 70, 70 and expected columns to 85, 115. Each contribution is non-negative; the largest gaps drive T. The 5% cut-off qchisq(0.95,2)=5.991, and 6.913 is beyond it, matching the P-value decision.

Goodness-of-fit branch: when one categorical variable is compared with fully stated p₀, use E=np₀ and df=k−1. For a two-way table, the margins are estimated from data and df=(r−1)(c−1). Small expected counts trigger simulation, not silent use of the curve.

Classic Traps + Exam Morningall chapters

TrapCorrection
density height = shareshare is area
N(μ,σ²): use second entry as SDtake its square root
r=0 means no relationonly no linear relation
ŷ−y residuale=y−ŷ
exclusive = independentpositive-probability exclusive events are dependent
add SEsadd squared SEs
large P proves H₀do not reject H₀
pairing ignoredanalyse differences
χ² has two tailsupper tail only
  1. Recite the method chooser and HATPC.
  2. Redraw the four tail shapes; label pnorm/pt.
  3. Check formula denominators, df and units.
https://www.asksia.ai/cheatsheet/usyd-stat5002 · Full STAT5002 study guide → · side 2/2
Shared by ________
Forward this to your tutorial groupv2 · 2026-10-25
Semester 2 formal examination period, from 16 November 2026 (the Exams Office publishes the exact date).
Check your exam instructions on the LMS for what you may bring; use this sheet to revise and self-test.

Want one for YOUR exact syllabus?

Sia is your free desktop study agent. Drop your University of Sydney STAT5002 slides — Sia builds a sheet tailored to YOUR exam. Better than this library because it knows YOUR materials.

↓ Download Sia · Free