Topic 10 - z-tests & t-tests Flashcards
L.O.
LO7 [capstone] Given real multivariate data and a problem, formulate an appropriate hypothesis and perform a range of hypothesis tests.
LO8 Interpret the p-value, conscious of the pitfalls associated with testing.
The z-test
- 1 sided or 2 sided
- HATPC process
- Used for mean or poportion
[heft]
The t-test
For when we don’t know the popSD
- Uses sample SD and t-distribution
- Used to investigate differences in means
- t-distribution varies in shape according to DoF (n-1)
When we don’t know the popSD
-
Estimate popSD from sampleSD and use z-test.
- Adds extra variability to test statistic due to samples containing different SD - Using t-test
t-Distribution
- Changes shape with DoF
- Bell shaped and symetrical
- 1DoF = lower peak and higher tails
- 20DoF = High peak and small tails
DoF = n-1
[heft]
Comparing z-test and t-test
Z test:
- P-curve = normal curve
- Rcode = pnorm
T test:
- P-curve = tn-1
- Rcode = pt
BOTH:
test stat = (OV-popMean) ÷ (sampleSD/ root(n))
Paired t-tests
HAT
H0: Mean for differences = 0
H1: mean for differences ≠ 0
Assumptions:
- Assume the population of differences is normal
- Each pair is independent
Test-stat:
- With a mean of 11.7 and sample SD of 10.8, we can substitute them into the formula to obtain the test stat;
11.7-0 ÷ (10.8 / root(9))
12.= 3.25
Two-sample t-tests
2 groups of people
[heft]
Assumptions for two-sample t-tests
- The 2 samples are independent (check context)
- The populations have equal spread (SD÷variance)
- The two populations are normal (check boxplots, no outliers, histograms, qqplot, normality test)
QQplot for normality
Check if data is normally spread
- Graphs the theoretical quantities based on normal curve against the actual quantities
- If the line formed by the points is reasonably straight, then the data is normally distributed
Shapiro-Wilk test for normality
- Tests the H0 that the data is normal:
H0 = data is consistent with normal distribution
H1 = Data is NOT consistent…
Test is very sensitive to sample size;
- small = normal
- large = not normal
Levene’s test (F-test) for equal spread
For Two-sample t-test
Tests the H0 that the 2 populations have equal spread
[heft]