A study compares resting heart rate between randomly sampled adults who run regularly and adults who do not. Which is the best definition of ?
Comparing two groups
Association between a two-level categorical explanatory variable and a quantitative response: boxplots, , the Welch t-test and interval, and the two-group effect size.
Key ideas
- Roles
Explanatory variable (here, the grouping) and response (the outcome). Roles say which way you are explaining, not that causes . Avoid "independent/dependent variable"; the course saves independence for the relationship.
- Informal evidence
Little overlap of side-by-side boxplots suggests association. Support it with one measure of center (medians or means) and one of location or spread (where the IQRs sit, or the extremes), written as sentences.
- Parameter
: the true difference in mean [response] between [population 1] and [population 2]. Two populations. Not "the mean difference," which is the paired parameter.
- Welch t-test
R always uses the Welch version with its own df. By hand the course uses the conservative .
- Reading an interval for
Entirely positive → evidence ; entirely negative → ; contains 0 → no evidence of a difference (not evidence of equality). Reversing the subtraction negates and swaps the endpoints.
- Independent versus paired
Different units in each group → two-sample. The same units measured twice → one-sample t on differences (Lec 07).
Formulas (on the Exam 2 help card)
Standing desks and daily steps
A company randomly samples 40 employees with standing desks and 50 with seated desks (employees chose their desks) and records average daily steps. Interpret the output.
t.test(steps ~ desk, data = staff)
Welch Two Sample t-test
data: steps by desk
t = 2.6291, df = 77.115, p-value = 0.01033
alternative hypothesis: true difference in means between group standing and group seated is not equal to 0
95 percent confidence interval:
266.8993 1933.101
sample estimates:
mean in group standing mean in group seated
8200 7100
# sample SDs: standing 2100, seated 1800Parameter: = the true difference in mean daily steps between all of the company's standing-desk employees and all of its seated-desk employees.
Statistic: steps; SE ; : the observed difference is 2.63 standard errors above the hypothesized 0.
p-value: assuming no difference in population mean steps, a t-statistic at least 2.63 away from 0 in either direction has probability about 0.010: strong evidence of a difference.
Interval: we are 95% confident standing-desk employees average between about 267 and 1,933 more daily steps than seated-desk employees. Entirely positive, consistent with the test.
Effect size: , moderate. By-hand df would be .
Strong evidence of an association between desk type and mean daily steps, with a moderate estimated effect. Employees chose their desks, so this is not evidence that the desk causes the difference (Lec 13–14).
Check yourself
Groups of 23 and 31 are compared with a two-sample t-test. Using the course's by-hand rule, what df would you use for the multiplier?
A 95% interval for (mean minutes to finish a puzzle, brand A minus brand B) is (−4.2, −0.6). What does it support?
Side-by-side boxplots compare monthly data use for two phone plans. Select every summary that is good evidence of an association.
Group 1: , . Group 2: , . Compute . Give the exact value.
A Welch test gives for . What sign does have, and what does the sign say?
A survey of a university's students asks whether each lives in a dorm and how many hours per week they spend at the gym. Which describes the roles and types?