Fit both models. The height difference on the surface settles the argument.
The Wald test never left the summit: it judged “is the slope zero?” from the full model's peak and its local curvature alone. The likelihood-ratio test does something more direct. It actually fits the rival model — the one where the slope is fixed at zero — and asks how much log-likelihood was lost by the restriction:
$$\Lambda \;=\; 2\left[\,\ell(\hat\beta_{\text{full}}) - \ell(\hat\beta_{\text{restricted}})\,\right]$$
The restricted model here is an old friend: with $\beta_1 = 0$, all that remains is a single mean — exactly the one-parameter model whose likelihood curve opened this section. On the heart-rate data at $n = 60$ the full peak reaches $\ell = -196.12$ while the best mean-only fit manages $-204.38$: a drop of $8.26$ log-likelihood units, so $\Lambda = 16.51$.
How big is big? Wilks' theorem: if the restriction were true, $\Lambda$ would follow a $\chi^2$ distribution with degrees of freedom equal to the number of parameters pinned down (here 1). A $\Lambda$ of 16.51 lands far beyond the 95% cut of $3.84$: $p \approx 4.8 \times 10^{-5}$. The nested model always sits lower — the question is only whether the drop exceeds what chance alone would cost.
The surface below is the profile log-likelihood over $(\beta_0, \beta_1)$ for the heart-rate data. The green dot is the full model's peak. The restricted model may only move along the dashed line $\beta_1 = 0$; the best it can do there is the orange dot. The height gauge on the right compares the two — the bracket is the test statistic. Drag the sample size and watch the gap grow as evidence accumulates.
Under the null, $\Lambda$ is a draw from the $\chi^2_1$ distribution below. The dashed line marks its 95% point, $3.84$ — algebraically the square of the Wald cut $1.96$, which is no coincidence: for one parameter the two tests agree exactly when the surface is perfectly quadratic, and drift apart as it isn't. The purple needle is the $\Lambda$ from your current sample size above.
On the Wald page, the small-sample logistic model rejected “no biomarker effect” with $p = 0.0048$. The likelihood-ratio route fits both logistic models and compares peaks: $\ell_{\text{full}} = -8.36$ against $\ell_{\text{null}} = -19.10$, giving $\Lambda = 21.47$ and $p = 3.6 \times 10^{-6}$ — evidence a thousand times sharper from the same data.
The discrepancy is the Wald test's local approximation at work: with $n = 30$ the surface is skewed (as the Bayesian page shows in detail), the standard error is inflated, and the Wald ratio understates what the whole surface knows. The LR test walked to both peaks and measured the actual drop.
# Gaussian: full vs mean-only (n = 60)
full <- lm(y ~ x, data = hr)
restricted <- lm(y ~ 1, data = hr)
lambda <- as.numeric(2 * (logLik(full) - logLik(restricted)))
pchisq(lambda, df = 1, lower.tail = FALSE)
# Logistic: full vs null (n = 30)
anova(glm(y ~ 1, data = trial, family = binomial),
glm(y ~ x, data = trial, family = binomial), test = "Chisq")
# logLik(full) -196.1212 logLik(restricted) -204.3777
# lambda = 16.5131, p = 4.832e-05
# Analysis of Deviance Table
# Resid. Df Resid. Dev Df Deviance Pr(>Chi)
# 1 29 38.191
# 2 28 16.719 1 21.472 3.59e-06 ***
from scipy import stats
import statsmodels.api as sm
# Gaussian: full vs mean-only (n = 60)
full = sm.OLS(y, sm.add_constant(x)).fit()
restricted = sm.OLS(y, np.ones_like(y)).fit()
lam = 2 * (full.llf - restricted.llf)
p = stats.chi2.sf(lam, df=1)
# Logistic: statsmodels stores the null fit for you
logit = sm.Logit(resp, sm.add_constant(bio)).fit()
lam2 = 2 * (logit.llf - logit.llnull)
# full.llf = -196.1212 restricted.llf = -204.3777
# lam = 16.5131, p = 4.832e-05
# logit.llf = -8.3593 logit.llnull = -19.0954
# lam2 = 21.4723, p = 3.59e-06
| Wald | Likelihood ratio | |
|---|---|---|
| Fits needed | One (the full model) | Two (full and restricted) |
| Information used | Peak location + local curvature | Actual surface heights at both optima |
| Fails when | Surface non-quadratic: boundaries, separation, small $n$ | Rarely earlier than Wald; needs nested models |
| In the wild | Every summary() row |
anova(..., test = "Chisq"), deviance tables,
confint() profiles |
Already met, in disguise. R's confint() on a GLM reports
profile-likelihood intervals: it slides each parameter along its axis and
keeps the values whose likelihood drop stays under the $\chi^2$ cut — the LR
test inverted, exactly as the Wald test inverted into $\hat\beta \pm 1.96\,\text{SE}$
on the previous page. That is why confint() and
the summary() intervals disagree precisely when this page and the last
one do.
Both tests need the models nested — one must be the other with parameters pinned. Choosing among non-nested rivals needs a different tool: AIC and BIC, next. On the sampling branch, the counterpart machinery is posterior comparison rather than a test ritual.