Lecture 24
Duke University
STA 199 - Fall 2026
November 30, 2026
Give feedback!
Take 2 minutes to fill out the TA evaluation form – link in your email! Due Monday, December 8th.
Nominate a TA for the StatSci TA of the Year award by sending an email to dus@stat.duke.edu with a brief narrative for your nomination.
Please also fill out the course evaluation (on DukeHub) as well, I’d love to your feedback!
![]() Allison Yang |
![]() Anric Ngan |
![]() Carl Emerson |
![]() Chelsea Nguyen |
![]() Ethan Cho |
![]() Helen Chen |
![]() Hellen Han |
![]() Hyunjin Lee |
![]() Josh Lim |
![]() Juan Pablo L. Escamilla |
![]() Kenna Roberts |
![]() Max Niu |
![]() Oliver Gao |
![]() Robbie Hao |
![]() Sophie Schwartz |
![]() Tally Coulter |
![]() Yasmine Abdel-Rahman |
Which of the following is true about confidence intervals?

Go to wooclap.com and use the code ZCUJHJN.
To estimate plausible values of a parameter of interest, e.g.,
Bootstrapping is a statistical procedure that resamples(with replacement) a single data set to create many simulated samples.
We then use these simulated samples to quantify the uncertainty around the sample statistic we’re interested in, e.g., a slope (\(b_1\)), a mean (\(\bar{x}\)), a proportion (\(\hat{p}\)).
Calculate the observed slope:
Take 1000 bootstrap samples and fit models to each one:
# A tibble: 2,000 × 3
# Groups: replicate [1,000]
replicate term estimate
<int> <chr> <dbl>
1 1 intercept 73046.
2 1 area 177.
3 2 intercept 7730.
4 2 area 205.
5 3 intercept 164620.
6 3 area 135.
7 4 intercept 90690.
8 4 area 170.
9 5 intercept 270437.
10 5 area 100.
# ℹ 1,990 more rows
reps = 1000 times
Percentile method: Compute the 95% CI as the middle 95% of the bootstrap distribution:
If you want to be very certain (i.e., more confident) that you capture the population parameter, should we use a wider or a narrower interval?

Go to wooclap.com and use the code ZCUJHJN.
What drawbacks are associated with using a wider interval?

How can we get best of both worlds – high precision and high accuracy?
Population: Complete set of observations of whatever we are studying, e.g., people, tweets, photographs, etc. – population size = \(N\)
Sample: Subset of the population, ideally random and representative – sample size = \(n\)
Sample statistic \(\ne\) population parameter, but if the sample is good, it can be a good estimate
Statistical inference: Discipline that concerns itself with the development of procedures, methods, and theorems that allow us to extract meaning and information from data that has been generated by stochastic (random) process
We report the estimate with a confidence interval, and the width of this interval depends on the variability of sample statistics from different samples from the population
Since we can’t continue sampling from the population, we bootstrap from the one sample we have to estimate sampling variability
Standard error method: Compute the 95% CI as the observed slope plus/minus ~2 * standard error (the standard deviation of the bootstrap distribution):
That quantity (~2 * standard error) is called the margin of error, e.g.,

In this class you learned how to construct a confidence interval (i.e., calculate the margin of error) using a computational method called bootstrapping.
The bootstrap distributions you constructed (given enough reps – repeated samples) were unimodal and symmetric around the observed statistic.
This is not a happenstance! And there is theory behind it… It’s called the Central Limit Theorem!
You can learn about the Central Limit Theorem and theory-based methods for constructing confidence intervals (and other inference procedures) in future stats courses.
Bootstrapping for categorical data
specify(response = x, success = "success level")
calculate(stat = "prop")
Bootstrapping for other stats
calculate() documentation: infer.tidymodels.org/reference/calculate.html
infer pipelines: infer.tidymodels.org/articles/observed_stat_examples.html
A hypothesis test is a statistical technique used to evaluate competing claims using data
Null hypothesis, \(H_0\): An assumption about the population. “There is nothing going on.”
Alternative hypothesis, \(H_A\): A research question about the population. “There is something going on”.
Note
Hypotheses are always at the population level!
Null hypothesis, \(H_0\): Defendant is innocent
Alternative hypothesis, \(H_A\): Defendant is guilty
Start with a null hypothesis, \(H_0\), that represents the status quo
Set an alternative hypothesis, \(H_A\), that represents the research question, i.e. what we’re testing for
Conduct a hypothesis test under the assumption that the null hypothesis is true and calculate a p-value (probability of observed or more extreme outcome given that the null hypothesis is true)
Predicting sleep duration from screen time.
Predicting the prices of houses in Duke Forest from their areas.
15 randomly sampled students’ responses to an online, anonymous survey:
Null hypothesis, \(H_0\): “There is nothing going on.” The slope of the model for predicting the sleep duration of Duke undergrads from their screen time is 0, \(\beta_1 = 0\).
Alternative hypothesis, \(H_A\): “There is something going on”. The slope of the model for predicting the sleep duration of Duke undergrads from their screen time is different than 0, \(\beta_1 \ne 0\).
Assume you live in a world where null hypothesis is true: \(\beta_1 = 0\).
Ask yourself how likely you are to observe the sample statistic, or something even more extreme, in this world:
\[ P \big( b_1 \leq -0.15~or~ b_1 \geq 0.15 ~|~ \beta_1 = 0 \big) \]
If there is no relationship between screen time and sleep, then any student’s sleep duration could just as easily have been paired with any other student’s screen time.
So, we can simulate a world where the null hypothesis is true by permuting (shuffling) the sleep durations across students, while keeping the screen times where they are.
Fitting a model to each shuffled dataset gives us a slope we might observe if the null hypothesis were true.
Doing this many times gives us the null distribution of the slope.
permWidget = {
const data = transpose(screen_sleep_data).map((d, i) => ({...d, id: i + 1}));
const n = data.length;
const navy = "#133955", maroon = "#8F2D56", blue = "steelblue";
const wrap = html`<div style="font-size: 0.75em;"></div>`;
const fit = (pts) => {
const mx = d3.mean(pts, d => d.screen), my = d3.mean(pts, d => d.sleep);
const sxx = d3.sum(pts, d => (d.screen - mx) ** 2);
if (sxx === 0) return null;
const b1 = d3.sum(pts, d => (d.screen - mx) * (d.sleep - my)) / sxx;
return {b0: my - b1 * mx, b1};
};
const obs = fit(data);
const fmt = d3.format(".1f"), fmt2 = d3.format(".2f");
// ---- layout ----
const W = 1000, H = 450;
const svg = d3.create("svg").attr("viewBox", [0, 0, W, H])
.style("width", "100%").style("height", "auto").style("font-family", "inherit");
// table of students
const rowH = Math.min(26, 340 / n), top = 85;
const rowY = (r) => top + rowH * (r + 0.5);
const fs = Math.min(15, rowH * 0.62);
const cols = {id: 60, screen: 160, sleep: 270, shuffled: 390};
svg.append("text").attr("x", 225).attr("y", 40).attr("text-anchor", "middle")
.attr("font-size", 20).attr("font-weight", "bold").attr("fill", navy).text(`The data: ${n} students`);
svg.append("g").attr("font-size", 13).attr("font-weight", "bold").attr("text-anchor", "middle")
.selectAll("text").data([
["Student", cols.id, "#222"], ["Screen", cols.screen, "#222"],
["Sleep", cols.sleep, "#999"], ["Shuffled sleep", cols.shuffled, blue]
]).join("text").attr("x", d => d[1]).attr("y", top - 10).attr("fill", d => d[2]).text(d => d[0]);
svg.append("g").selectAll("rect").data(d3.range(n)).join("rect")
.attr("x", 20).attr("y", r => top + rowH * r).attr("width", 440).attr("height", rowH)
.attr("fill", r => r % 2 ? "#f6f6f6" : "none");
const gTable = svg.append("g").attr("font-size", fs).attr("text-anchor", "middle");
gTable.append("g").selectAll("text").data(data).join("text")
.attr("x", cols.id).attr("y", (d, i) => rowY(i)).attr("dy", "0.35em").attr("fill", navy)
.attr("font-weight", "bold").text(d => `#${d.id}`);
gTable.append("g").selectAll("text").data(data).join("text")
.attr("x", cols.screen).attr("y", (d, i) => rowY(i)).attr("dy", "0.35em").attr("fill", "#222")
.text(d => fmt(d.screen));
gTable.append("g").selectAll("text").data(data).join("text")
.attr("x", cols.sleep).attr("y", (d, i) => rowY(i)).attr("dy", "0.35em").attr("fill", "#999")
.text(d => fmt(d.sleep));
// shuffled sleep values: one text per original student, moved to its new row
const shuffled = gTable.append("g").selectAll("text").data(data).join("text")
.attr("x", cols.shuffled).attr("y", (d, i) => rowY(i)).attr("dy", "0.35em")
.attr("fill", blue).attr("font-weight", "bold").text(d => fmt(d.sleep));
// scatterplot
const pad = ([lo, hi], p = 0.08) => { const w = (hi - lo) || 1; return [lo - p * w, hi + p * w]; };
const sx = d3.scaleLinear(pad(d3.extent(data, d => d.screen)), [600, 980]);
const sy = d3.scaleLinear(pad(d3.extent(data, d => d.sleep)), [385, 85]);
svg.append("text").attr("x", 790).attr("y", 40).attr("text-anchor", "middle")
.attr("font-size", 20).attr("font-weight", "bold").attr("fill", navy).text("Fit to the shuffled data");
svg.append("g").attr("transform", "translate(0,385)").call(d3.axisBottom(sx).ticks(5))
.call(g => g.selectAll("text").attr("font-size", 12));
svg.append("g").attr("transform", "translate(600,0)").call(d3.axisLeft(sy).ticks(5))
.call(g => g.selectAll("text").attr("font-size", 12));
svg.append("text").attr("x", 790).attr("y", 420).attr("text-anchor", "middle")
.attr("font-size", 13).text("Screen time (hours/day)");
svg.append("text").attr("transform", "translate(560,235) rotate(-90)").attr("text-anchor", "middle")
.attr("font-size", 13).text("Sleep (hours/night)");
const clipId = DOM.uid("permclip");
svg.append("clipPath").attr("id", clipId.id).append("rect")
.attr("x", 600).attr("y", 85).attr("width", 380).attr("height", 300);
const gLines = svg.append("g").attr("clip-path", clipId);
const lineAt = (sel, f) => sel
.attr("x1", sx.range()[0]).attr("x2", sx.range()[1])
.attr("y1", sy(f.b0 + f.b1 * sx.domain()[0])).attr("y2", sy(f.b0 + f.b1 * sx.domain()[1]));
lineAt(gLines.append("line"), obs).attr("stroke", maroon).attr("stroke-width", 2.5).attr("stroke-dasharray", "6,4");
const permLine = gLines.append("line").attr("stroke", blue).attr("stroke-width", 3).attr("opacity", 0);
const ghosts = svg.append("g").selectAll("circle").data(data).join("circle")
.attr("cx", d => sx(d.screen)).attr("cy", d => sy(d.sleep)).attr("r", 5)
.attr("fill", "none").attr("stroke", "#bbb").attr("stroke-width", 1.5);
const dots = svg.append("g").selectAll("circle").data(data).join("circle")
.attr("cx", d => sx(d.screen)).attr("cy", d => sy(d.sleep)).attr("r", 6)
.attr("fill", blue).attr("fill-opacity", 0.6).attr("stroke", navy).attr("stroke-width", 1.5);
// ---- controls ----
const btn = (label) => html`<button style="font-size: 1em; margin-right: 0.3em; padding: 0.15em 0.6em; cursor: pointer;">${label}</button>`;
const bShuffle = btn("Shuffle"), bReset = btn("Reset");
const status = html`<div style="margin-top: 0.3em; font-size: 0.9em; min-height: 1.4em;"></div>`;
const history = html`<div style="font-size: 0.85em; color: #555;"></div>`;
const legend = html`<div style="font-size: 0.85em; color: #555;">
<span style="color: ${maroon};">━ ━</span> observed fit
<span style="color: ${blue};">━━</span> fit to shuffled data
<span style="color: #999;">○</span> observed data
<span style="color: ${blue};">●</span> shuffled data
</div>`;
wrap.append(html`<div>${[bShuffle, bReset]}</div>`, status, svg.node(), legend, history);
// ---- state ----
// perm[r] = index of the student whose sleep value now sits in row r
let perm = d3.range(n), slopes = [];
const dur = 900;
function render(animate) {
const rowOf = new Array(n);
perm.forEach((j, r) => { rowOf[j] = r; });
const pts = data.map((d, r) => ({screen: d.screen, sleep: data[perm[r]].sleep}));
const t = (sel) => animate ? sel.transition().duration(dur).ease(d3.easeCubicInOut) : sel;
t(shuffled).attr("y", (d, j) => rowY(rowOf[j]));
t(dots).attr("cy", (d, r) => sy(pts[r].sleep));
const f = fit(pts);
const isObs = perm.every((j, r) => j === r);
ghosts.attr("opacity", isObs ? 0 : 1);
if (isObs) {
permLine.attr("opacity", 0);
status.innerHTML = `Observed data. Click <b>Shuffle</b> to randomly reassign the sleep values to students.`;
} else {
lineAt(t(permLine.attr("opacity", 1)), f);
status.innerHTML = `Slope of the shuffled data: <b style="color: ${blue};">${fmt2(f.b1)}</b>` +
` (observed: <span style="color: ${maroon};">${fmt2(obs.b1)}</span>)`;
}
history.innerHTML = slopes.length
? `Slopes from shuffled data so far (${slopes.length}): ${slopes.map(fmt2).join(", ")}`
: `Observed slope (all ${n} students): <b style="color: ${maroon};">${fmt2(obs.b1)}</b>`;
}
bShuffle.onclick = () => {
perm = d3.shuffle(d3.range(n));
const pts = data.map((d, r) => ({screen: d.screen, sleep: data[perm[r]].sleep}));
slopes.push(fit(pts).b1);
render(true);
};
bReset.onclick = () => { perm = d3.range(n); slopes = []; render(true); };
invalidation.then(() => { shuffled.interrupt(); dots.interrupt(); permLine.interrupt(); });
render(false);
return wrap;
}nullWidget = {
const data = transpose(screen_sleep_data);
const n = data.length;
const navy = "#133955", maroon = "#8F2D56", blue = "steelblue";
const wrap = html`<div style="font-size: 0.75em;"></div>`;
const fit = (pts) => {
const mx = d3.mean(pts, d => d.screen), my = d3.mean(pts, d => d.sleep);
const sxx = d3.sum(pts, d => (d.screen - mx) ** 2);
if (sxx === 0) return null;
const b1 = d3.sum(pts, d => (d.screen - mx) * (d.sleep - my)) / sxx;
return {b0: my - b1 * mx, b1};
};
// one permutation: shuffle sleep across students, keep screen time in place
const permute = () => {
const s = d3.shuffle(data.map(d => d.sleep));
const pts = data.map((d, i) => ({screen: d.screen, sleep: s[i]}));
return {pts, ...fit(pts)};
};
const obs = fit(data);
const cut = Math.abs(obs.b1) - 1e-9;
const isExtreme = (b) => Math.abs(b) >= cut;
const pad = ([lo, hi], p = 0.05) => { const w = (hi - lo) || 1; return [lo - p * w, hi + p * w]; };
const xDom = pad(d3.extent(data, d => d.screen));
const yDom = pad(d3.extent(data, d => d.sleep));
// fix the slope axis up front (symmetric around 0) so it doesn't jump around
const preview = d3.range(1000).map(() => Math.abs(permute().b1));
const sLim = 1.15 * Math.max(Math.abs(obs.b1), d3.quantile(preview, 0.999));
// bins of ~1/30 of the axis, with edges at 0 and at ± the observed slope,
// so no bin mixes "as or more extreme" dots with the rest
const m = Math.max(1, Math.round(15 * Math.abs(obs.b1) / sLim));
const sStep = Math.abs(obs.b1) / m || sLim / 15;
const nBins = 2 * Math.ceil(sLim / sStep), sMax = (nBins / 2) * sStep;
const sDom = [-sMax, sMax];
// negative values round toward 0's side so that exactly -|observed| lands in the extreme bin
const binOf = (b) => {
const u = (b + sMax) / sStep;
return Math.min(nBins - 1, Math.max(0, b < 0 ? Math.ceil(u) - 1 : Math.floor(u)));
};
// dot plot geometry (pixels), used to size the dots so the stacks fit
const dpW = 460, dpH = 360, dpM = {top: 20, right: 15, bottom: 40, left: 45};
const binPx = (dpW - dpM.left - dpM.right) / nBins;
let current = null, slopes = [], lines = [], timer = null;
const btn = (label) => html`<button style="font-size: 1em; margin-right: 0.3em; padding: 0.15em 0.6em; cursor: pointer;">${label}</button>`;
const bOne = btn("Shuffle 1"), bTen = btn("+ 10"), bHundred = btn("+ 100"),
bPlay = btn("▶ Play"), bReset = btn("Reset");
const speed = html`<input type="range" min="10" max="1000" value="500" style="width: 7em; vertical-align: middle;">`;
const status = html`<div style="margin-top: 0.3em; font-size: 0.85em;"></div>`;
const plots = html`<div style="display: flex; gap: 1em; flex-wrap: wrap;"></div>`;
const legend = html`<div style="font-size: 0.85em; color: #555;">
<span style="color: ${maroon};">━ ━</span> observed fit
<span style="color: ${blue};">━━</span> current shuffled fit
<span style="color: #999;">━━</span> previous shuffled fits
<span style="color: ${maroon};">┃</span> ± observed slope
<span style="color: ${maroon};">●</span> = as or more extreme than observed
<span style="color: #999;">●</span> <span style="color: ${blue};">◯</span> = current shuffle
</div>`;
wrap.append(
html`<div>${[bOne, bTen, bHundred, bPlay, bReset]} <span style="margin-left: 0.5em;">slow</span> ${speed} <span>fast</span></div>`,
status, plots, legend
);
const lineMark = (arr, opts) => Plot.link(arr, {
x1: () => xDom[0], x2: () => xDom[1],
y1: d => d.b0 + d.b1 * xDom[0], y2: d => d.b0 + d.b1 * xDom[1],
clip: true, ...opts
});
function draw() {
const pts = current ? current.pts : data;
const scatter = Plot.plot({
width: 460, height: 360, style: {fontSize: "13px"},
x: {domain: xDom, label: "Screen time (hours/day)"},
y: {domain: yDom, label: "Sleep (hours/night)"},
marks: [
Plot.frame({stroke: "#ddd"}),
lineMark(lines.slice(0, -1), {stroke: "#999", strokeOpacity: 0.2}),
Plot.dot(pts, {x: "screen", y: "sleep", r: 5, fill: current ? blue : navy, fillOpacity: 0.6, stroke: navy}),
lineMark([obs], {stroke: maroon, strokeWidth: 2.5, strokeDasharray: "6,4"}),
current ? lineMark([current], {stroke: blue, strokeWidth: 3}) : null
].filter(Boolean)
});
// stacked dot plot: one dot per shuffle, stacked within bins of the slope
const heights = new Array(nBins).fill(0);
const dots = slopes.map((b, i) => {
const bin = binOf(b);
const k = heights[bin]++;
return {x: -sMax + sStep * (bin + 0.5), y: k + 0.5, extreme: isExtreme(b), last: i === slopes.length - 1};
});
const yMax = Math.max(10, d3.max(heights));
const r = Math.max(0.8, 0.45 * Math.min(binPx, (dpH - dpM.top - dpM.bottom) / yMax));
const dotplot = Plot.plot({
width: dpW, height: dpH, style: {fontSize: "13px"},
marginTop: dpM.top, marginRight: dpM.right, marginBottom: dpM.bottom, marginLeft: dpM.left,
x: {domain: sDom, label: "Slope from shuffled data"},
y: {domain: [0, yMax], label: "Count", grid: true},
color: {type: "identity"},
marks: [
Plot.dot(dots, {
x: "x", y: "y", r,
fill: d => d.extreme ? maroon : "#999",
stroke: d => d.last ? blue : "none", strokeWidth: 2
}),
Plot.ruleY([0]),
Plot.ruleX([-obs.b1, obs.b1], {stroke: maroon, strokeWidth: 2.5}),
current ? Plot.ruleX([current.b1], {stroke: blue, strokeWidth: 2, strokeOpacity: 0.7}) : null
].filter(Boolean)
});
plots.replaceChildren(scatter, dotplot);
const k = slopes.filter(isExtreme).length;
status.innerHTML =
`n = ${n} · <b>${slopes.length}</b> shuffles · observed slope = ${obs.b1.toFixed(2)}` +
(current ? ` · current slope = ${current.b1.toFixed(2)}` : "") +
(slopes.length ? ` · as or more extreme: ${k} / ${slopes.length} = <b>${(k / slopes.length).toFixed(3)}</b>` : "");
}
const add = (k) => {
for (let j = 0; j < k; j++) {
current = permute();
slopes.push(current.b1);
lines.push(current);
}
if (lines.length > 200) lines = lines.slice(-200);
draw();
};
const stop = () => { clearTimeout(timer); timer = null; bPlay.textContent = "▶ Play"; };
const tick = () => { add(1); timer = setTimeout(tick, 1010 - speed.value); };
bOne.onclick = () => add(1);
bTen.onclick = () => add(10);
bHundred.onclick = () => add(100);
bPlay.onclick = () => {
if (timer) stop();
else { bPlay.textContent = "⏸ Pause"; tick(); }
};
bReset.onclick = () => { stop(); current = null; slopes = []; lines = []; draw(); };
invalidation.then(stop);
draw();
return wrap;
}specify()Specify the response and explanatory variables:
hypothesize()Declare the null hypothesis – sleep and screen are independent:
Response: sleep (numeric)
Explanatory: screen (numeric)
Null Hypothesis: inde...
# A tibble: 15 × 2
sleep screen
<dbl> <dbl>
1 6 6
2 5 2.5
3 7.5 8.7
4 8.12 2.75
5 6.5 11.9
6 8.63 7.8
7 7 5.8
8 8.5 6
9 8.5 10.4
10 7 5.5
11 6 5.3
12 7 5.9
13 8.32 6.23
14 6.15 5.6
15 6 5
generate()Generate 1000 permuted datasets by shuffling sleep across students:
Response: sleep (numeric)
Explanatory: screen (numeric)
Null Hypothesis: inde...
# A tibble: 15,000 × 3
# Groups: replicate [1,000]
sleep screen replicate
<dbl> <dbl> <int>
1 6.5 6 1
2 6 2.5 1
3 5 8.7 1
4 8.5 2.75 1
5 7 11.9 1
6 7 7.8 1
7 7.5 5.8 1
8 8.63 6 1
9 6 10.4 1
10 8.12 5.5 1
# ℹ 14,990 more rows
fit()Fit a model to each permuted dataset, and save the result:
# A tibble: 2,000 × 3
# Groups: replicate [1,000]
replicate term estimate
<int> <chr> <dbl>
1 1 intercept 8.02
2 1 screen -0.147
3 2 intercept 6.84
4 2 screen 0.0380
5 3 intercept 6.66
6 3 screen 0.0666
7 4 intercept 6.91
8 4 screen 0.0262
9 5 intercept 6.01
10 5 screen 0.168
# ℹ 1,990 more rows
Based on the p-value calculated, what is the conclusion of the hypothesis test? Interpret it in the context of screen time and sleep.
Which pair of hypotheses is correct for testing whether area is a useful predictor of price for houses in Duke Forest?

Go to wooclap.com and use the code ZCUJHJN.
Null hypothesis, \(H_0\): “There is nothing going on.” The slope of the model for predicting the prices of houses in Duke Forest from their areas is 0, \(\beta_1 = 0\).
Alternative hypothesis, \(H_A\): “There is something going on”. The slope of the model for predicting the prices of houses in Duke Forest from their areas is different than, \(\beta_1 \ne 0\).
The p-value for this test is the probability of…

Go to wooclap.com and use the code ZCUJHJN.
… which we have already done:
# A tibble: 2,000 × 3
# Groups: replicate [1,000]
replicate term estimate
<int> <chr> <dbl>
1 1 intercept 568295.
2 1 area -3.02
3 2 intercept 597577.
4 2 area -13.6
5 3 intercept 560760.
6 3 area -0.310
7 4 intercept 556322.
8 4 area 1.29
9 5 intercept 588234.
10 5 area -10.2
# ℹ 1,990 more rows
Before we plot it: where do you expect the null distribution of slopes to be centered?

Go to wooclap.com and use the code ZCUJHJN.
If we shade the area beyond \(\pm 159\) on the null distribution, what will the shaded area look like?

Go to wooclap.com and use the code ZCUJHJN.
Warning: Please be cautious in reporting a p-value of 0. This result is an approximation
based on the number of `reps` chosen in the `generate()` step.
ℹ See `get_p_value()` (`?infer::get_p_value()`) for more information.
Please be cautious in reporting a p-value of 0. This result is an approximation
based on the number of `reps` chosen in the `generate()` step.
ℹ See `get_p_value()` (`?infer::get_p_value()`) for more information.
# A tibble: 2 × 2
term p_value
<chr> <dbl>
1 area 0
2 intercept 0
R reports a p-value of 0. What’s the best interpretation?

Go to wooclap.com and use the code ZCUJHJN.
Which conclusion is best supported by this hypothesis test?

Go to wooclap.com and use the code ZCUJHJN.
In Example 1 (screen time and sleep), the p-value was about 0.23, so we fail to reject \(H_0\). What does that mean?

Go to wooclap.com and use the code ZCUJHJN.