
Lecture 17
Duke University
STA 101 Fall 2026
2026-11-03
We want to understand how two numerical variables \(X\) and \(Y\) are related;
We do so through the lens of this model:
\[ Y=\beta_0+\beta_1X+\varepsilon. \]
\(\beta_1\) describes the relationship, and we want to know what it is;
Using a messy, meager, incomplete, imperfect sample of data, we construct our best guess:
\[ \widehat{Y}=b_0+b_1X. \]
\(b_1\) is our point estimate of \(\beta_1\). How reliable is it?
Pay close attention to the similarities and differences:


In statistics, we quantify uncertainty with distributions:
(This is where things start to resemble AP Stats)
Recall the openintro::loans_full_schema data frame:
10000 rows;
each row is an approved loan applicant;
the columns contain financial info about that person, including…
What is the relationship between these two variables?


























These are not accidents!
Theorem
As your sample size gets bigger and bigger, the sampling distribution of many statistics (OLS slope, sample mean, sample proportion, etc) will look more and more like a bell curve that is concentrating around the true value you are trying to estimate.
For the proof, take STA 240 and beyond!

Notation: \(N(\mu,\,\sigma)\)
#| '!! shinylive warning !!': |
#| shinylive does not work in self-contained HTML documents.
#| Please set `embed-resources: false` in your metadata.
#| standalone: true
#| viewerHeight: 500
library(shiny)
ui <- fluidPage(
titlePanel("The normal distribution"),
sidebarLayout(
sidebarPanel(
sliderInput(
inputId = "mu",
label = "Mean (μ)",
min = -5,
max = 5,
value = 0,
step = 0.1
),
sliderInput(
inputId = "sigma",
label = "Standard deviation (σ)",
min = 0.5,
max = 3,
value = 1,
step = 0.1
)
),
mainPanel(
plotOutput("density_plot")
)
)
)
server <- function(input, output) {
output$density_plot <- renderPlot({
x <- seq(-10, 10, length.out = 1000)
y <- dnorm(x, mean = input$mu, sd = input$sigma)
plot(
x, y,
type = "l",
col = "steelblue",
lwd = 3,
xlim = c(-10, 10),
ylim = c(0, 0.85),
xlab = "x",
ylab = "Density",
main = paste0("N(", input$mu, ", ", input$sigma, ")")
)
polygon(
c(x, rev(x)),
c(y, rep(0, length(y))),
col = adjustcolor("steelblue", alpha.f = 0.2),
border = NA
)
#abline(v = input$mu, col = "firebrick", lty = 2, lwd = 2)
})
}
shinyApp(ui, server)(in the container)
The central limit theorem (CLT) says that if our sample size (\(n\)) is “large enough,” then our estimate of the slope (\(b_1\)) varies across datasets according to
\[ N(\text{mean} = \beta_1,\,\text{sd}=\text{SE}) \]
\[ N(\text{mean} = \beta_1,\,\text{sd}=\text{SE}) \]
The standard error measures the spread of the sampling distribution, which communicates uncertainty about the estimate. SE higher bad; SE lower good.
The value of the SE is influenced by two factors:
So, the SE is a tug-of-war between the noisiness of the data and how much of it you have.
\[ N(\text{mean} = \beta_1,\,\text{sd}=\text{SE}) \]
It’s been staring us in the face the entire time:
# A tibble: 2 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 (Intercept) 37.3 1.88 19.9 8.24e-19
2 wt -5.34 0.559 -9.56 1.29e-10
So how do we use it for interval estimation and hypothesis testing?