liveBook · Manning

F-statistic

As explained in Effective Data Analysis

An F-statistic is a test statistic that compares explained variation with unexplained variation in an analysis of variance or regression model.

The F-statistic tests a regression model’s overall statistical significance: do its predictors collectively influence the outcome? It compares explained with unexplained variation. Read it with its p-value, which indicates how unusual an F-statistic at least this large would be if the predictors collectively had no influence. section 9.1.2

The F-test asks a different question from an individual predictor’s t-test. R-squared describes how much outcome variation the predictors explain; adjusted R-squared also accounts for added predictors. These measures help put an F-test result in context, but none replaces a check of the model’s residuals. section 9.1.2 section 9.2.2

From a promising result to a data check

A regression of daily rat sightings on temperature, wind speed, and weekday produced a large, statistically significant overall F-statistic. Residual inspection then revealed unusual records, including one whose missing weather values had been filled with zero. Statistical significance was a reason to investigate the model—not a reason to stop checking it. section 9.2.2

import statsmodels.api as sm

import pandas as pd
housing_prices = pd.read_csv("housing_prices.csv")     #1

X = housing_prices[["sq_footage", "n_bedrooms"]]
y = housing_prices["price"]     #2
X = sm.add_constant(X)     #3

model = sm.OLS(y, X).fit()     #4
print(model.summary())

Fit an ordinary least squares housing-price model with statsmodels and print its summary to inspect the F-statistic alongside other diagnostics. section 9.1.2

How Effective Data Analysis covers it

How deep it goes
Explains the collective test and accompanying p-value, then interprets model output without deriving the statistic.
Examples
Uses housing-price and daily rat-sighting regressions to interpret F-statistics alongside model summaries and residual plots.
What it assumes
Assumes basic familiarity with regression predictors, outcomes, and statistical tests; explains the F-test’s question without a formula.
What you can do after
Evaluate/understand it in a regression summary to assess collective predictor significance while checking residuals before trusting the model.
How it connects
Connects the F-test to p-values, null hypotheses, R-squared, individual predictor t-tests, and residual diagnostics.

Also explained in

Compare how 2 books explain f-statistic →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Data Analysis. The section links point to the parts of the book it draws on.