Skip to main content
v2026.11,986 entries · CC-BY 4.0

Score Test: Formula, Worked Example and Calculation

Understand the Rao score test through a worked proportion example, null-model formulas, interpretation, and Excel, R and Python calculations.

Written and maintained by CASRAI Editorial Board

Published

On this page

A score test tests a statistical parameter restriction by measuring the slope of the log likelihood at the null-model estimate, scaled by Fisher information. Also called the Rao or Lagrange multiplier test, it needs only the restricted fit. The worked example below shows how using the null variance, rather than the fitted variance, produces the score statistic.

Score test definition

The score test asks whether the likelihood has a sufficiently large slope away from a hypothesized restriction to count as evidence against that restriction. The score is a derivative of the log likelihood, not a questionnaire total or a prediction score. A small standardized slope is compatible with the restriction; a large one suggests that releasing it would improve the fit.

In research analysis, the restriction might set a population proportion to a prespecified benchmark or set a block of regression coefficients to zero. UCLA OARC explains the latter using a logistic model: the score approach fits the model without the candidate predictors and assesses evidence for adding them. The hypothesis concerns the whole specified block when several coefficients are constrained together.

The distinction from the likelihood ratio test for nested models is computational. That test compares two optimized likelihoods. The score test evaluates derivatives at the restricted estimate. A Wald test instead starts from the unrestricted estimate. Their agreement is an asymptotic result under suitable conditions, rather than a guarantee of identical finite-sample results.

Score test formula and every symbol explained

For a regular likelihood model with parameter vector θ and null restriction, write the score statistic as:

S = U(θ̃)ᵀ I(θ̃)⁻¹ U(θ̃).

  • θ is the vector of model parameters.
  • θ̃ is the maximum-likelihood estimate subject to the null restriction.
  • ℓ(θ) is the log likelihood for the entire sample.
  • U(θ) = ∇ℓ(θ) is its score vector, containing the first derivatives.
  • I(θ) is expected Fisher information for the entire sample, evaluated here at θ̃.
  • ᵀ means transpose; ⁻¹ means matrix inverse.
  • S is the resulting scalar test statistic.

Under the usual likelihood regularity conditions, compare S with a chi-square distribution having q degrees of freedom, where q is the number of independent restrictions: the difference between full- and null-model dimensions. Geyer’s likelihood notes give this construction and also an observed-information variant. Record which form was used; they need not produce the same number in a finite sample.

If there is one parameter, no nuisance parameters, and H₀: θ = θ₀, the expression becomes S = U(θ₀)² / I(θ₀). Its signed counterpart is z = U(θ₀) / √I(θ₀), with S = z². The sign retains direction; squaring removes it.

With nuisance parameters, estimate those parameters under H₀. Geyer’s multivariable notes use the full score vector and full information matrix at that fit. Nuisance-direction score components vanish at the restricted optimum, but their relationships with the tested parameters still enter through the inverse matrix. Simply discarding those relationships and inverting the tested block can change the test. The guide to Fisher information and its interpretation explains the scaling quantity.

Worked research example with arithmetic

Illustrative composite, not observed study data: a research data team reviews 200 independently generated records for a binary acceptance criterion. Suppose 118 pass. Before examining the results, the team specifies H₀: π = .50 against H₁: π ≠ .50. Here π denotes the underlying acceptance probability; the benchmark and counts are hypothetical.

For this illustration, assume identical acceptance probability across independent records. Let x = 118 successes, n = 200 trials and π₀ = .50. The observed proportion is π̂ = 118 / 200 = .59. There are no nuisance parameters to estimate in this one-parameter model.

The binomial log likelihood, omitting a constant that does not depend on π, is ℓ(π) = x log(π) + (n − x) log(1 − π). Differentiation gives U(π) = (x − nπ) / [π(1 − π)]. Expected information is I(π) = n / [π(1 − π)], as given in Geyer’s binomial likelihood example.

  1. Under H₀, expected successes are 200 × .50 = 100; expected failures are also 100.
  2. The score is U(π₀) = (118 − 100) / (.50 × .50) = 18 / .25 = 72.
  3. The information is I(π₀) = 200 / .25 = 800.
  4. The statistic is S = 72² / 800 = 5,184 / 800 = 6.48.
  5. The signed statistic is z = 72 / √800 = 2.545584; its square is 6.48.
  6. The upper-tail chi-square probability with one degree of freedom is approximately .01091, the two-sided score-test p-value.

A separate arithmetic check uses the binomial Pearson expression: (118 − 100)² / 100 + (82 − 100)² / 100 = 3.24 + 3.24 = 6.48. This is the same uncorrected statistic, rather than another independent analysis of the records. It verifies that the derivative calculation used the intended counts.

At the illustrative threshold α = .05, this result rejects the specified null benchmark. The descriptive difference is .59 − .50 = .09, or nine percentage points. Neither the hypothetical significance threshold nor the benchmark is a general research-quality standard. They are inputs to this example, and another analysis must justify its own inputs.

Interpretation: what the score-test result means

Read the statistic together with its restrictions and reference distribution. The same numerical S can imply different tail probabilities at different degrees of freedom. The definition of a p-value helps distinguish a tail probability under the null model from a probability assigned to the null hypothesis itself.

Output Reading guidance
S near zero The standardized null-model score is small; its upper-tail chi-square probability is large.
Large S relative to its chi-square distribution The upper-tail probability is small, providing evidence against the specified restrictions under the model assumptions.
Positive versus negative signed z In the one-proportion example, the sign distinguishes an observed proportion above versus below π₀; S alone loses that distinction.

These readings follow the score formulas and chi-square calibration in Geyer’s notes. The data table below separately compares the fitted models and evaluation points for score, Wald and likelihood ratio tests; it combines university explanations with the R implementation details.

A useful report keeps the estimate visible. In the illustration, 118 of 200 and the nine-percentage-point difference describe the observed departure. S = 6.48 describes that departure after null-based scaling. Calling 6.48 the size of the acceptance-rate improvement would confuse the test statistic with the quantity being measured.

Assumptions and common mistakes

Specify the sampling model. The binomial calculation above assumes independent binary trials with the same success probability. Records repeatedly measured from the same underlying unit would not satisfy that stated independence assumption merely because they occupy separate spreadsheet rows. The arithmetic can still return 6.48 even when its sampling interpretation is inappropriate.

Keep null and fitted variance separate. The score denominator for the example is nπ₀(1 − π₀), not nπ̂(1 − π̂). Substitution of .59 changes that denominator to 48.38 and gives 324 / 48.38 = 6.696982 for the corresponding Wald statistic. This difference is expected from the two constructions; it is not a rounding discrepancy.

Use consistent information scaling. The formula above uses a total-sample score and total-sample information. Combining the total score with information for one observation introduces a sample-size factor. Writing the sample convention next to the formula makes this error easier to detect before interpreting output.

Do not treat the approximation as exact. Geyer’s binomial notes distinguish asymptotic score inference from exact binomial inference. R’s documentation likewise labels the chi-square reference approximate and points to binom.test for an exact binomial hypothesis test. For the discrete one-proportion setting, see the binomial test and its exact calculation.

State the tail and correction. The worked S uses a two-sided proportion alternative and no continuity correction. A directional test requires a specified direction and the signed statistic. R’s default continuity correction also changes the calculation, so matching only the counts is insufficient when reproducing a result.

Do not select whichever classical test is significant. Geyer’s statistical-model notes caution against trying Wald, likelihood ratio and score tests and choosing the favorable p-value. Prespecifying the analysis avoids turning legitimate finite-sample differences into an undisclosed selection rule.

How to report a score test: APA-style example

Identify the null restriction, sample size, test family, degrees of freedom, p-value and relevant calculation choices. For the clearly hypothetical records above, an APA-style results sentence is:

In this illustrative dataset, 118 of 200 records met the criterion (59%). An uncorrected, two-sided score test rejected the null acceptance probability of .50, χ²(1, N = 200) = 6.48, p = .011.

The APA Style seventh-edition Numbers and Statistics Guide supports omitting the leading zero for a significance probability and distinguishing Greek symbols from italic statistical Latin symbols. In manuscript typography, italicize N and p; do not italicize χ. The sentence above is an illustrative reporting example, rather than a verbatim passage from the manual.

For a regression application, replace the acceptance probability with the actual coefficient restrictions and identify any nuisance adjustment or information choice. Do not reuse the example’s one degree of freedom for a multi-coefficient test. A joint restriction on two independent coefficient directions requires its own dimensional accounting and calculation.

How to calculate the score test in Excel, R and Python

These snippets implement the same uncorrected one-proportion example. They are not general replacements for a likelihood-model implementation with nuisance parameters. Keep the counts and null probability together so another researcher can reconstruct the calculation without inferring inputs from a rounded p-value.

Excel

Enter 118 in B1, 200 in B2 and 0.5 in B3. In B4 enter =(B1-B2*B3)^2/(B2*B3*(1-B3)). In B5 enter =CHISQ.DIST.RT(B4,1). B4 gives 6.48 and B5 approximately 0.01091. Microsoft documents CHISQ.DIST.RT as the right-tail probability for the supplied chi-square statistic and degrees of freedom.

Although Excel calls this a right-tail probability, it corresponds here to the two-sided proportion alternative: the statistic already squares a signed departure. Do not double B5 again. The spreadsheet formula assumes valid counts, positive n and a null probability strictly between zero and one.

R

prop.test(x = 118, n = 200, p = 0.5, alternative = ‘two.sided’, correct = FALSE)

Read X-squared = 6.48, df = 1 and the p-value near .01091. The R manual defines x as successes and n as trials, and documents the continuity-correction option. Supplying correct = FALSE is essential to match the uncorrected arithmetic above; the default is TRUE.

Python

from math import erfc, sqrt
x, n, p0 = 118, 200, 0.5
z = (x - n*p0) / sqrt(n*p0*(1-p0))
statistic = z*z
p_value = erfc(abs(z)/sqrt(2))
print(statistic, p_value)

This standard-library calculation gives 6.48 and approximately 0.01091. It uses the identity between a one-degree-of-freedom chi-square tail and the two-sided standard-normal tail. Python documents erfc as the complementary error function. For q greater than one, this particular normal-tail shortcut does not calculate the required chi-square probability.

Sources

Data: Score, Wald and likelihood ratio test calculation requirements

Original crosswalk compiling the fitted-model requirements and statistic inputs described by UCLA OARC and University of Minnesota likelihood notes, with implementation distinctions from the Minnesota and R documentation. The rows compare regular likelihood tests; asymptotic equivalence does not guarantee identical finite-sample results.

Score, Wald and likelihood ratio test calculation requirements
TestMaximum-likelihood fit requiredStatistic inputImplementation distinctionSources
Score (Rao / Lagrange multiplier)Restricted null modelScore vector and Fisher information evaluated at restricted estimatesThe uncorrected one-proportion example corresponds to R prop.test with correct = FALSE.https://www.stat.umn.edu/geyer/5421/notes/likelihood.html ; https://stat.ethz.ch/R-manual/R-patched/library/stats/html/prop.test.html
WaldUnrestricted full modelEstimated departure from the restriction scaled by information at unrestricted estimatesR summary output for glm coefficients gives Wald tests.https://www.stat.umn.edu/geyer/5421/notes/likelihood.html ; https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faqhow-are-the-likelihood-ratio-wald-and-lagrange-multiplier-score-tests-different-andor-similar/
Likelihood ratio (Wilks)Restricted null model and unrestricted full modelTwice the difference of maximized log likelihoodsR glm analysis of deviance with a chi-square likelihood-ratio comparison uses both fits.https://www.stat.umn.edu/geyer/5421/notes/likelihood.html ; https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faqhow-are-the-likelihood-ratio-wald-and-lagrange-multiplier-score-tests-different-andor-similar/

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Score Test: Formula, Worked Example and Calculation

2 free questions a day, no account.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →