---
title: "Truncated Regression: What If Only the Tall Sons Had Been Measured?"
description: "Truncated regression in R, by hand with optim() and with truncreg, on Galton's family heights: we keep only the sons of 68 inches or more, as an army with a minimum height would, and try to recover the truth that the full data show. Truncated normal likelihood, why least squares is biased, the inverse Mills ratio, truncation against censoring (Tobit), what rounding, a wrong cut-off and non-normal errors do, restricted maximum likelihood and APA reporting."
author: ""
---
```{r options, echo=FALSE, warning=FALSE, message=FALSE}
directory<-if (rstudioapi::isAvailable()) paste0(dirname(rstudioapi::getActiveDocumentContext()$path),"/") else ""
source(paste0(directory, "R/code_options.R"))
# no knitr cache: the page downloads its data each time it runs (in about a second),
# and a cached chunk would quietly keep an old download
knitr::opts_chunk$set(fig.height = 4.5, cache = FALSE)
```
## The question: the records of a tall army
Historians learn how tall people were, and so how well they were fed, from the records of armies. But many armies had a **minimum height**. Shorter men were sent away, and nobody wrote them down. From such records the population looks too tall. And a regression on them, for example of a son's height on his parents' heights, gives **wrong slopes**, as we shall see.
A sample is **truncated** when the cases beyond a limit are missing altogether. We do not know who they were, nor how many. Other examples: an experiment that admits only families with an income below some limit (Hausman & Wise, 1977), a survey of firms with more than ten employees, the patients of a clinic that admits only those above some blood value.
**Truncated regression** tries to recover the line of the full population from the truncated sample. Can it? With real truncated data one never knows, because the truth is missing. So we use data for which we **know** the truth, Galton's heights from [simple linear regression](EXAMPLE_SIMPLE_LINEAR_REGRESSION.Rmd), and make the truncated sample ourselves: an imaginary guard regiment that takes only sons of **68 inches (173 cm) or more**.
```{r packages}
library(ggplot2)
library(truncreg) # truncreg(): truncated normal regression
library(survival) # survreg(): the censored (Tobit) model, for comparison (comes with R)
line_colours <- c(
"all sons (the truth)" = "grey25",
"OLS, tall sons only" = "#eb6834",
"truncated regression" = "#2a78d6"
)
# number formats for the text
f1 <- function(x) formatC(x, format = "f", digits = 1, big.mark = ",")
f2 <- function(x) formatC(x, format = "f", digits = 2, big.mark = ",")
f3 <- function(x) formatC(x, format = "f", digits = 3, big.mark = ",")
# no leading zero
nz <- function(x, d = 2) sub("^(-?)0", "\\1", formatC(x, format = "f", digits = d))
pval <- function(p) if (p < .001) "< .001" else paste("=", nz(p, 3))
pct <- function(x, d = 0) paste0(formatC(100 * x, format = "f", digits = d), "%")
```
---
## 1. The data
```{r download}
galton <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/HistData/GaltonFamilies.csv")
sons <- subset(galton, gender == "male", select = c(family, father, mother, childHeight))
names(sons)[4] <- "son"
minimum <- 68 # inches
guards <- subset(sons, son >= minimum) # all that the regiment's records contain
c(all_sons = nrow(sons), in_the_records = nrow(guards), missing = nrow(sons) - nrow(guards))
```
Galton's (1886) file has `r nrow(sons)` adult sons with the heights of both parents, in inches. The records of our regiment contain `r nrow(guards)` of them. The other `r nrow(sons) - nrow(guards)` (`r pct(1 - nrow(guards) / nrow(sons))`) do not exist for it.
The truth that we want to recover is the regression on **all** the sons:
```{r truth}
full <- lm(son ~ father + mother, data = sons)
truth <- c(coef(full), sigma = sigma(full))
round(truth, 3)
```
---
## 2. Look at the data
```{r look, fig.height = 5.5}
naive <- lm(son ~ father + mother, data = guards)
sons$kept <- sons$son >= minimum
# lines against the father's height, at the mean of the mother's height
line_at <- function(b) c(intercept = b[[1]] + b[[3]] * mean(sons$mother), slope = b[[2]])
two <- rbind(line_at(coef(full)), line_at(coef(naive)))
ggplot(sons, aes(father, son)) +
geom_point(
aes(shape = kept, alpha = kept),
position = position_jitter(width = 0.15, height = 0.1, seed = 1),
size = 1.6,
colour = "grey30"
) +
geom_hline(yintercept = minimum, linetype = "dashed") +
geom_abline(
aes(intercept = two[1, 1], slope = two[1, 2], colour = "all sons (the truth)"),
linewidth = 1
) +
geom_abline(
aes(intercept = two[2, 1], slope = two[2, 2], colour = "OLS, tall sons only"),
linewidth = 1
) +
scale_shape_manual(values = c(`TRUE` = 16, `FALSE` = 1), guide = "none") +
scale_alpha_manual(values = c(`TRUE` = 0.6, `FALSE` = 0.35), guide = "none") +
scale_colour_manual(values = line_colours, name = NULL) +
labs(
title = "The regiment sees only the points above the dashed line",
x = "father's height (inches)",
y = "son's height (inches)"
) +
theme_bw() +
theme(legend.position = "bottom")
```
The orange line, fitted to the filled points only, is **too flat**. The reason can be seen at the left. Sons of short fathers are short on average, so only the unusually tall ones pass the limit: there the records contain only positive errors. Sons of tall fathers pass whatever their error is. So the errors of the men in the records are **related to the father's height**, and least squares is biased.
```{r bias_table}
cbind(all_sons = coef(full), tall_sons_only = coef(naive))
c(SD_all = sigma(full), SD_tall = sigma(naive))
```
The slope of the father's height falls from `r f2(coef(full)[["father"]])` to `r f2(coef(naive)[["father"]])`, that of the mother's from `r f2(coef(full)[["mother"]])` to `r f2(coef(naive)[["mother"]])`, and the residual standard deviation from `r f2(sigma(full))` to `r f2(sigma(naive))`. A larger sample of tall sons would not help. It is the wrong population.
---
## 3. The model step by step, with formulas
### Step 1: the line of the whole population
$$y_i = \beta_0 + \beta_1\, \text{father}_i + \beta_2\, \text{mother}_i + \varepsilon_i, \qquad \varepsilon_i \sim N(0, \sigma^2)$$
We see case $i$ only if $y_i \ge c$, with $c = 68$.
### Step 2: the distribution of those we see
Among all the sons of such parents, the heights have a normal curve around $\mu_i = \beta_0 + \beta_1 \text{father}_i + \beta_2 \text{mother}_i$. Cut off the part below $c$. What remains has an area of $P(y_i \ge c) = \Phi\!\big(\frac{\mu_i - c}{\sigma}\big)$, less than 1. To be a distribution again it must be divided by that area. The result is the **truncated normal** density:
$$f(y_i \mid y_i \ge c) = \frac{\frac{1}{\sigma}\,\phi\!\left(\frac{y_i - \mu_i}{\sigma}\right)}{\Phi\!\left(\frac{\mu_i - c}{\sigma}\right)}$$
($\phi$ is the height of the standard normal curve, `dnorm()`; $\Phi$ the area to the left, `pnorm()`.)
```{r truncated_density}
shape <- do.call(
rbind,
lapply(c(66.5, 69, 72), function(mu) {
h <- seq(60, 80, by = 0.05)
data.frame(
h,
whole = dnorm(h, mu, truth[["sigma"]]),
seen = ifelse(
h >= minimum,
dnorm(h, mu, truth[["sigma"]]) / pnorm((mu - minimum) / truth[["sigma"]]),
NA
),
label = sprintf(
"expected height %.1f: %s seen",
mu,
pct(pnorm((mu - minimum) / truth[["sigma"]]))
)
)
})
)
ggplot(shape, aes(h)) +
geom_area(data = subset(shape, !is.na(seen)), aes(y = seen), fill = "#2a78d6", alpha = 0.35) +
geom_line(aes(y = whole), colour = "grey40") +
geom_vline(xintercept = minimum, linetype = "dashed") +
facet_wrap(~ label, ncol = 1) +
labs(title = "All the sons (line), and those in the records (blue), for three pairs of parents",
x = "son's height (inches)", y = "density") +
theme_bw()
```
### Step 3: the average of those we see
The mean of the truncated normal is **above** the line:
$$E(y_i \mid y_i \ge c) = \mu_i + \sigma\, \lambda(\alpha_i), \qquad \lambda(\alpha) = \frac{\phi(\alpha)}{1 - \Phi(\alpha)}, \qquad \alpha_i = \frac{c - \mu_i}{\sigma}$$
$\lambda$ is the **inverse Mills ratio**. It is large when most of the curve is cut off ($\mu_i$ far below $c$) and goes to zero when nothing is. So the mean of the sons in the records is pushed up most where the parents are short. This term, which OLS does not know, is the bias.
### Step 4: maximum likelihood
Add up the logarithms of the densities of step 2, and find the $\beta$'s and $\sigma$ that make the sum as large as possible:
$$\log L = \sum_i \left[ \log \frac{1}{\sigma}\phi\!\left(\frac{y_i - \mu_i}{\sigma}\right) - \log \Phi\!\left(\frac{\mu_i - c}{\sigma}\right) \right]$$
The first part is the ordinary normal likelihood. The second is the correction. It says: *take into account that I could not have seen it otherwise*. The estimates are consistent if the model is right (Amemiya, 1973).
```{r by_hand}
X <- model.matrix(naive); y <- guards$son
minus_loglik <- function(par, X, y, cut) {
# par: the coefficients, then log(sigma)
mu <- drop(X %*% par[-length(par)])
s <- exp(par[length(par)])
-sum(dnorm(y, mu, s, log = TRUE) - pnorm((mu - cut) / s, log.p = TRUE))
}
start <- c(coef(naive), log(sigma(naive))) # start from OLS
hand <- optim(start, minus_loglik, X = X, y = y, cut = minimum, method = "BFGS", hessian = TRUE,
control = list(maxit = 1000, reltol = 1e-12, parscale = c(10, 0.1, 0.1, 0.1)))
c(hand$par[-4], sigma = exp(hand$par[[4]]), logLik = -hand$value)
```
---
## 4. Fitting the model and reading the output
```{r fit}
fit <- truncreg(son ~ father + mother, data = guards, point = minimum, direction = "left")
summary(fit)
b <- coef(fit); se <- sqrt(diag(vcov(fit)))
```
`point` is the cut-off and `direction = "left"` says that the values below it are missing. The estimates agree with our own.
- **`father`**, **`mother`**: the change in the **full population's** expected height for one inch. These are the numbers we are after.
- **`sigma`**: the residual standard deviation in the full population.
- There is no $R^2$, and the *t* tests are large-sample *z* tests.
```{r comparison}
compare <- data.frame(
term = c("Intercept", "Father", "Mother", "sigma"),
truth = truth, OLS_tall = c(coef(naive), sigma(naive)),
truncated = b, SE = se,
z_from_truth = (b - truth) / se, row.names = NULL)
print(cbind(term = compare$term, round(compare[, -1], 3)), row.names = FALSE)
```
```{r comparison_chart}
plot_data <- rbind(
data.frame(
term = c("Father", "Mother"),
est = coef(full)[-1],
se = coef(summary(full))[-1, 2],
method = "all sons (the truth)"
),
data.frame(
term = c("Father", "Mother"),
est = coef(naive)[-1],
se = coef(summary(naive))[-1, 2],
method = "OLS, tall sons only"
),
data.frame(
term = c("Father", "Mother"),
est = b[2:3],
se = se[2:3],
method = "truncated regression"
)
)
plot_data$method <- factor(plot_data$method, levels = rev(names(line_colours)))
ggplot(plot_data, aes(est, term, colour = method)) +
geom_vline(xintercept = 0, colour = "grey60") +
geom_pointrange(
aes(xmin = est - 1.96 * se, xmax = est + 1.96 * se),
position = position_dodge(width = 0.5),
linewidth = 0.9
) +
scale_colour_manual(values = line_colours, name = NULL) +
labs(title = "Slopes with 95% intervals", x = "inches of son per inch of parent", y = NULL) +
theme_bw() +
theme(legend.position = "bottom")
```
The truncated regression brings the slopes back: `r f2(b[["father"]])` for the father (truth: `r f2(truth[["father"]])`) and `r f2(b[["mother"]])` for the mother (truth: `r f2(truth[["mother"]])`), and $\sigma$ = `r f2(b[["sigma"]])` (truth: `r f2(truth[["sigma"]])`). The price is the standard error: `r f2(se[["father"]])` instead of the `r f2(coef(summary(full))["father", 2])` of the full data. The intervals are **honest**: they are wide, and they contain the truth. The narrow OLS intervals do not.
### Two kinds of effect
The slope $\beta_1$ is the effect in the whole population. If the question is about the **men in the regiment**, it is the slope of $E(y \mid y \ge c)$, which is smaller:
$$\frac{\partial E(y \mid y \ge c)}{\partial x} = \beta_1 \left[1 - \lambda(\alpha)\,\big(\lambda(\alpha) - \alpha\big)\right]$$
```{r marginal}
mu <- drop(X %*% b[1:3])
alpha <- (minimum - mu) / b[["sigma"]]
mills <- dnorm(alpha) / pnorm(alpha, lower.tail = FALSE)
shrink <- 1 - mills * (mills - alpha) # always between 0 and 1
cbind(
value = c(
average_factor = mean(shrink),
effect_in_the_population = b[["father"]],
effect_among_the_tall = b[["father"]] * mean(shrink),
OLS = coef(naive)[["father"]]
)
)
```
Averaged over the men in the records, the factor is `r f2(mean(shrink))`, so one inch of father goes with `r f2(b[["father"]] * mean(shrink))` inches among the tall sons: about what OLS found. OLS is not "wrong". It answers the question about the regiment, and people read it as an answer about the population.
---
## 5. Truncated or censored?
A **censored** sample is less damaged. There we know **how many** cases are beyond the limit, and their predictors; only the exact outcome is missing. Suppose that the regiment had written down the parents' heights of the rejected sons, with the note "below 68". That is the [Tobit model](EXAMPLE_TOBIT.Rmd):
```{r tobit}
sons$recorded <- pmax(sons$son, minimum)
tobit <- survreg(
Surv(recorded, son >= minimum, type = "left") ~ father + mother,
data = sons,
dist = "gaussian"
)
rbind(truth = truth[1:3], tobit = coef(tobit), truncated = b[1:3])
rbind(truth = coef(summary(full))[, 2], tobit = sqrt(diag(vcov(tobit)))[1:3], truncated = se[1:3])
```
| | Truncated | Censored |
|---|---|---|
| Cases beyond the limit | missing | present, with the value "beyond the limit" |
| Their predictors | unknown | known |
| Their number | unknown | known |
| Model | truncated regression | Tobit |
| Standard error of the father's slope here | `r f3(se[["father"]])` | `r f3(sqrt(diag(vcov(tobit)))[["father"]])` |
The standard error of the Tobit slope is less than half as large. It is worth a lot to write down even those who are turned away. The most expensive mistake is to treat a censored sample as truncated, by deleting the cases at the limit.
---
## 6. What can go wrong
The correction rests on three assumptions: we know the **cut-off**, the cut-off was applied **strictly**, and the errors are **normal**, right down to the tail that we cannot see. Each can fail.
### Rounding moves the cut-off
Most of Galton's heights are rounded to an inch or a half inch. A son written down as 68 may be 67.75. So the true limit of the records is a bit **below** 68:
```{r rounding}
share_whole <- mean(guards$son %% 1 == 0)
cuts <- c(68, 67.75, 67.5)
moved <- t(sapply(cuts, function(cc) {
m <- truncreg(son ~ father + mother, data = guards, point = cc, direction = "left")
c(cut = cc, coef(m)[2:4])
}))
round(rbind(moved, truth = c(NA, truth[2:4])), 3)
```
`r pct(share_whole)` of the heights in the records are whole inches. Taking 67.75 or 67.5 as the limit changes the father's slope from `r f2(moved[1, "father"])` to `r f2(moved[2, "father"])` and `r f2(moved[3, "father"])`. A quarter of an inch matters that much, because the heights are densest near the limit and the correction depends on how the curve is cut there. The right treatment is a likelihood for intervals ("the son is between 67.5 and 68.5"). The smallest honest step is to report the results for more than one limit.
### The errors must be normal
The model extends the curve that it sees into the part that it does not see. If the hidden tail has another shape, it is wrong. A simulation with the real parents' heights and the true line, and three kinds of errors with the same standard deviation:
```{r simulation}
set.seed(17)
Xf <- model.matrix(full); line <- drop(Xf %*% truth[1:3]); s0 <- truth[["sigma"]]
kinds <- list(normal = function(n) rnorm(n, 0, s0),
`long tails (t, 4 df)` = function(n) rt(n, 4) * s0 / sqrt(2),
`skewed (long to the right)` = function(n) (rgamma(n, 4) - 4) / 2 * s0)
reps <- 500
sim <- lapply(kinds, function(draw) {
t(replicate(reps, {
yy <- line + draw(length(line))
keep <- yy >= minimum
d <- data.frame(son = yy, father = Xf[, 2], mother = Xf[, 3])[keep, ]
o <- coef(lm(son ~ father + mother, d))
m <- try(
suppressWarnings(truncreg(
son ~ father + mother,
data = d,
point = minimum,
direction = "left"
)),
silent = TRUE
)
c(OLS = o[["father"]], truncated = if (inherits(m, "try-error")) NA else coef(m)[["father"]])
}))
})
bias <- do.call(
rbind,
lapply(names(sim), function(k) {
data.frame(
errors = k,
true = truth[["father"]],
OLS = mean(sim[[k]][, "OLS"]),
truncated = mean(sim[[k]][, "truncated"], na.rm = TRUE),
SD_OLS = sd(sim[[k]][, "OLS"]),
SD_truncated = sd(sim[[k]][, "truncated"], na.rm = TRUE),
failed = sum(is.na(sim[[k]][, "truncated"]))
)
})
)
print(cbind(errors = bias$errors, round(bias[, -1], 3)), row.names = FALSE)
```
```{r simulation_chart}
sim_long <- do.call(
rbind,
lapply(names(sim), function(k) {
data.frame(
errors = k,
slope = as.vector(sim[[k]]),
method = rep(c("OLS, tall sons only", "truncated regression"), each = reps)
)
})
)
sim_long$errors <- factor(sim_long$errors, levels = names(kinds))
ggplot(sim_long, aes(slope, fill = method, colour = method)) +
geom_density(alpha = 0.3, na.rm = TRUE) +
geom_vline(xintercept = truth[["father"]], linetype = "dashed") +
facet_wrap(~errors, ncol = 1) +
coord_cartesian(xlim = c(0, 1)) +
scale_fill_manual(values = line_colours, name = NULL) +
scale_colour_manual(values = line_colours, name = NULL) +
labs(
title = "500 simulated regiments: the slope of the father's height",
subtitle = "Dashed: the true slope",
x = "estimated slope",
y = NULL
) +
theme_bw() +
theme(legend.position = "bottom", axis.text.y = element_blank(), axis.ticks.y = element_blank())
```
- With **normal** errors the truncated regression is right on average (`r f2(bias$truncated[1])`, truth `r f2(truth[["father"]])`), and OLS is far off (`r f2(bias$OLS[1])`).
- With **long tails** it gives `r f2(bias$truncated[2])`, and with **skewed** errors `r f2(bias$truncated[3])`. The correction is biased in both cases. With skewed errors it is off by `r pct(abs(bias$truncated[3] / truth[["father"]] - 1))`.
- Even when it is right on average, it is **imprecise**: the spread of the estimates is `r f1(bias$SD_truncated[1] / bias$SD_OLS[1])` times that of OLS.
Our errors are close to normal (the full data allow us to check), so the method had a fair chance here. With a truly truncated sample this check is impossible: the tail that would show it is the missing one.
### How much can be cut away?
```{r cutoffs}
limits <- c(64, 66, 67, 68, 69, 70)
by_limit <- do.call(
rbind,
lapply(limits, function(cc) {
d <- subset(sons, son >= cc)
m <- truncreg(son ~ father + mother, data = d, point = cc, direction = "left")
data.frame(
limit = cc,
kept = nrow(d),
share = nrow(d) / nrow(sons),
OLS = coef(lm(son ~ father + mother, d))[["father"]],
truncated = coef(m)[["father"]],
SE = sqrt(vcov(m)["father", "father"])
)
})
)
round(by_limit, 3)
```
With a quarter of the sons missing (limit 68) the estimate is still usable. When more than half of them are missing (limit 70) the standard error is `r f2(by_limit$SE[6])`, more than half of the true slope. And OLS becomes flatter and flatter.
---
## 7. Borrowing a number: restricted maximum likelihood
The weak part of the estimation is $\sigma$. From the cut curve alone it is hard to tell a wide distribution with a low mean from a narrow one with a high mean, and errors in $\sigma$ carry over to the slopes. Height is a special case, because its spread is nearly the same in all populations that have been measured. A'Hearn (2004) proposed to **fix** $\sigma$ at a known value and to estimate the rest:
```{r restricted}
with_sigma <- function(s_fixed) {
f <- function(par) minus_loglik(c(par, log(s_fixed)), X = X, y = y, cut = minimum)
o <- optim(
coef(naive),
f,
method = "BFGS",
hessian = TRUE,
control = list(maxit = 1000, reltol = 1e-12, parscale = c(10, 0.1, 0.1))
)
list(b = o$par, se = sqrt(diag(solve(o$hessian))))
}
known <- with_sigma(truth[["sigma"]])
rbind(truth = truth[1:3], free_sigma = b[1:3], fixed_sigma = known$b)
rbind(free_sigma = se[1:3], fixed_sigma = known$se)
low <- with_sigma(0.9 * truth[["sigma"]]); high <- with_sigma(1.1 * truth[["sigma"]])
c(
father_if_sigma_10pct_too_small = low$b[["father"]],
father_if_sigma_10pct_too_large = high$b[["father"]]
)
```
With $\sigma$ known, the standard error of the father's slope falls from `r f3(se[["father"]])` to `r f3(known$se[["father"]])`. But if the borrowed value is 10% too small or too large, the slope becomes `r f2(low$b[["father"]])` or `r f2(high$b[["father"]])`. Here we cheated and took the true value. In practice the value comes from other studies, and it must be the spread **given the predictors**, not the plain one.
---
## 8. Things to keep in mind
- **Is it really truncated?** If you know how many cases are beyond the limit, it is censored: use [Tobit](EXAMPLE_TOBIT.Rmd). If the cases are missing because of **another** variable (people who did not answer, women who do not work), it is sample selection, the subject of the [Heckman model](EXAMPLE_HECKMAN_SELECTION.Rmd).
- **Selecting on a predictor is harmless.** Keeping only the sons of tall **fathers** does not bias the slope (it costs precision). Only selection on the outcome does.
- **The limit must be known and strict.** In real armies, short volunteers were let in when soldiers were needed, and the density near the limit thins out gradually. Historians cut at a higher point, where the records are complete.
- **Normality cannot be checked** where it matters. Try other distributions (`crch::trch()` has logistic and *t* errors) and report how much the answer moves.
- **The two limits** can be on both sides: `crch` and `gamlss.tr` handle them.
- **Counts without zeros** (the number of visits of those who visited) need the zero-truncated Poisson or negative binomial.
- **Standard errors here ignore that brothers share their parents.** For the full data we used cluster-robust errors in [simple linear regression](EXAMPLE_SIMPLE_LINEAR_REGRESSION.Rmd); for the truncated model, bootstrap the families.
- **No miracle.** The correction replaces missing information by an assumption. If the conclusion depends on it, say so.
---
## 9. Reporting the results in APA style
A report (APA 7th edition) needs the limit and why it exists, the number of cases seen, the distribution that was assumed, the estimates with their uncertainty, and what they refer to. The numbers come from the R objects:
```{r apa_numbers}
z <- b / se
pv <- 2 * pnorm(-abs(z))
apa_table <- data.frame(
Predictor = c("Intercept", "Father's height", "Mother's height", "σ"),
full = paste0(f2(truth), c(paste0(" (", f2(coef(summary(full))[, 2]), ")"), "")),
ols = paste0(
f2(c(coef(naive), sigma(naive))),
c(paste0(" (", f2(coef(summary(naive))[, 2]), ")"), "")
),
tr = paste0(f2(b), " (", f2(se), ")"),
ci = paste0("[", f2(b - 1.96 * se), ", ", f2(b + 1.96 * se), "]"),
p = c(sapply(pv[1:3], function(p) sub("^= ", "", pval(p))), "—")
)
```
**Method** (data analysis):
> Only sons with a height of at least `r minimum` inches were in the sample (`r nrow(guards)` of the `r nrow(sons)` sons in Galton's records; the limit was imposed for this example). Because selection depended on the outcome, we regressed the son's height on the heights of both parents with a truncated normal regression, estimated by maximum likelihood with a left truncation point of `r minimum`. The coefficients refer to the population without truncation. We examined the sensitivity to the truncation point (67.5 and 67.75 inches, because heights were rounded). Analyses were conducted in R (Version `r paste(R.version$major, R.version$minor, sep = ".")`; R Core Team, `r R.version$year`) with the package truncreg (Croissant & Zeileis, 2026).
**Results:**
> In the truncated regression, the son's height increased with that of the father, *b* = `r f2(b[["father"]])`, *SE* = `r f2(se[["father"]])`, 95% CI [`r f2(b[["father"]] - 1.96 * se[["father"]])`, `r f2(b[["father"]] + 1.96 * se[["father"]])`], *z* = `r f2(z[["father"]])`, *p* `r pval(pv[["father"]])`, and of the mother, *b* = `r f2(b[["mother"]])`, *SE* = `r f2(se[["mother"]])`, 95% CI [`r f2(b[["mother"]] - 1.96 * se[["mother"]])`, `r f2(b[["mother"]] + 1.96 * se[["mother"]])`], *z* = `r f2(z[["mother"]])`, *p* `r pval(pv[["mother"]])` (Table 1). Ordinary least squares on the same sample gave `r f2(coef(naive)[["father"]])` and `r f2(coef(naive)[["mother"]])`. With truncation points of 67.75 and 67.5 inches, the coefficient of the father's height was `r f2(moved[2, "father"])` and `r f2(moved[3, "father"])`.
**Table 1**
*Son's Height From the Parents' Heights: Full and Truncated Samples*
```{r apa_table, echo=FALSE}
knitr::kable(apa_table, col.names = c("Predictor", "All sons, OLS", "Tall sons, OLS", "Tall sons, truncated", "95% CI", "*p*"),
align = "lrrrrr", format = "pipe", row.names = FALSE)
```
*Note.* Estimates with standard errors in parentheses. All sons: *N* = `r nrow(sons)`. Tall sons (at least `r minimum` inches): *N* = `r nrow(guards)`. The confidence interval and *p* value belong to the truncated regression.
**Points to remember:**
- Say what was truncated, where, and how you know the limit.
- Say that the coefficients are for the untruncated population.
- Show OLS next to it, and the sensitivity to the limit.
- State the assumption of normality as an assumption.
---
## 10. Summary
| | |
|---|---|
| **When** | Cases beyond a known limit of the **outcome** are missing from the sample |
| **Why not OLS** | The errors of those who remain are related to the predictors: slopes too flat |
| **The model** | Truncated normal: the normal density divided by the probability of being seen |
| **How (R)** | `truncreg::truncreg(y ~ x, data, point = c, direction = "left")` |
| **Coefficients** | For the whole population; for those in the sample, multiply by $1 - \lambda(\lambda - \alpha)$ |
| **Censored instead** | If the number and predictors of the others are known: [Tobit](EXAMPLE_TOBIT.Rmd), much more precise |
| **Assumptions** | Known and strict limit, normal errors with constant variance |
| **Weak points** | Imprecise, and sensitive to rounding, the limit and the shape of the errors |
| **Related pages** | [Tobit](EXAMPLE_TOBIT.Rmd), [simple linear regression](EXAMPLE_SIMPLE_LINEAR_REGRESSION.Rmd) |
---
## References
A'Hearn, B. (2004). A restricted maximum likelihood estimator for truncated height samples. *Economics & Human Biology*, *2*(1), 5–19. https://doi.org/10.1016/j.ehb.2003.12.003
Amemiya, T. (1973). Regression analysis when the dependent variable is truncated normal. *Econometrica*, *41*(6), 997–1016. https://doi.org/10.2307/1914031
Croissant, Y., & Zeileis, A. (2026). *truncreg: Truncated Gaussian regression models* (R package version 0.3-0). https://CRAN.R-project.org/package=truncreg
Galton, F. (1886). Regression towards mediocrity in hereditary stature. *The Journal of the Anthropological Institute of Great Britain and Ireland*, *15*, 246–263. https://doi.org/10.2307/2841583
Hausman, J. A., & Wise, D. A. (1977). Social experimentation, truncated distributions, and efficient estimation. *Econometrica*, *45*(4), 919–938. https://doi.org/10.2307/1912682