Português

Overall F-test of a regression

Models and regression · reference distribution: F(k, n−k−1)

When to use it

Test whether the regression model as a whole explains anything, or whether all coefficients may be zero.

Null hypothesis

All coefficients (except the intercept) are zero.

Assumptions

Test statistic

F = \dfrac{R^2 / k}{(1 - R^2) / (n - k - 1)}

Effect size

Cohen’s f². Benchmarks: 0.02, 0.15 and 0.35.

f^2 = \dfrac{R^2}{1 - R^2}

How to report it

F(2, 47) = 9.4, p < .001, R² = .29

In R and Python

R
summary(lm(y ~ x1 + x2, data = df))  # the F is on the last line
Python
import statsmodels.formula.api as smf
m = smf.ols("y ~ x1 + x2", data=df).fit()
m.fvalue, m.f_pvalue

In Python, stats is scipy.stats and np is numpy.

Variants and alternatives

Where it sits in the catalog

Models and regression. Tests run inside a fitted model: whether a coefficient matters, whether the model explains anything and whether the residuals meet the assumptions.

In the decision tree

  1. What do you want to do? Test a regression model
  2. What do you want to test? Whether the model as a whole explains anything

Open the decision tree