Bartlett correction 2026-10-14
A Bartlett correction rescales a regular likelihood-ratio test statistic so that its null expected value matches its limiting chi-squared degrees of freedom to a higher asymptotic order. If , divide by . The operation uses a model-specific Bartlett correction coefficient; matching the mean alone is not a general proof of any claimed distributional error rate.
The coefficient is the leading relative null-mean discrepancy of a regular likelihood-ratio test statistic. It is distinct from the finite-sample divisor used in a Bartlett correction. Different conventions call either of these a correction factor, so the normalization should always be stated explicitly.
For a sample of size from a normal distribution with unknown mean, the null variance likelihood-ratio test statistic is , where . With , its expected Taylor terms start with . Here , , and . Higher fixed-order terms contribute only under valid termwise asymptotic integration. Thus and .
With fixed , compare and by maximizing the ordinary likelihood function in both models. Their likelihood-ratio test statistic is unchanged by , , because both maximized log-likelihoods change by the same . Its null law can therefore be simulated using independent responses. Comparing the observed statistic with simulated statistics by gives a conservative finite-sample Monte Carlo p-value, subject to correctly maximizing both likelihoods.
The displayed age groups have fairly similar employment proportions, with no coherent monotone age trend. The printed test reports no evidence against age–employment independence; recomputing from the five visible rows reaches the same qualitative conclusion. Their totals and several auxiliary fields nevertheless do not represent one consistent table.
Each row percentage estimates an employment proportion within that age group. For example, of the youngest displayed group are employed. The employed proportions in the next four rows are , , and . The largest displayed proportion is in the 45–54 group and the smallest in the 55–64 group, a difference of about percentage points. These are conditional percentages, not the age distribution of employed people. The sequence rises and then falls; there is no simple increasing or decreasing pattern.
The null hypothesis for a Pearson chi-squared test of independence is that the joint category probabilities factor into their age and employment marginals. Its expected frequencies are , and its test statistic adds the standardized squared count discrepancies, . For a complete contingency table with positive margins, the large-sample reference chi-squared distribution has statistical degrees of freedom. Independent observations and an appropriate sampling scheme are essential; adequate expected counts make the approximation more plausible.[ref]
Reading only the printed test block, , statistical degrees of freedom and are mutually compatible. The printed likelihood-ratio test gives nearly the same p-value, about . At a prechosen 5% significance level neither rejects independence. This is a failure to find evidence, not proof of equal employment probabilities at every age. The printed Cramér's V around suggests a small sample association; the contingency coefficient around has the same broad message. The generalized phi coefficient is an unsigned chi-squared magnitude here, not evidence for a positive age trend. A small association magnitude and a large p-value answer different questions.
But only a table is actually visible. Those rows total , with employment column sums and , rather than the printed with columns and . Computing solely from the five visible rows gives
Its likelihood-ratio test statistic is about , again with statistical degrees of freedom. The smallest count-based expected frequency is about , comfortably large for this ordinary approximation, but different from the printed minimum . These figures are a labelled analysis of the visible subset, not a repaired full dataset. An unprinted sixth age row might explain some intended metadata, but neither its label nor a uniquely justified reconstruction is supplied. The oldest printed label also conflicts with Figures 1 and 8.
The ordinal measures look for an ordered tendency. Goodman and Kruskal's gamma compares concordant pairs with discordant pairs among pairs untied on both variables. The printed negative gamma, Somers' D, Kendall's tau-b and Stuart's tau-c therefore suggest, at most, a very weak tendency toward lower employment at higher age categories under the specified ordering. Their precise magnitudes are not reliable here. The ordinary unordered-pair partition for ordinal data fails for the printed pair counts, even when compared with the printed cases. On the five visible rows the respective count-based values are about , for employment conditional on age, and . None gives a substantial monotone pattern; a near-zero ordinal measure would not exclude a nonmonotone relationship in general.
Goodman and Kruskal's lambda is zero in both predictive directions on the visible table: knowing age does not improve the number of correct predictions made by always choosing the most common employment category, and knowing employment does not improve modal age-category prediction. Zero modal-prediction improvement does not mean every category distribution is identical. Both the reported test block and the separately recomputed visible-table test fail to reject independence; neither justifies asserting no association, a causal age effect, or a coherent full-sample calculation from the contradictory printout.
Within the 1424 complete records displayed here, employed respondents report more frequent use on average in the ordinal sense of positive pairwise association. The overall independence test is significant, but its sample association magnitude is modest and the result is observational. Some printed ordinal summaries are internally inconsistent.
Compare row percentages because employment groups have different sizes. Never-use is reported by of the non-employed group and of the employed group. Daily use is versus ; more-than-daily use is versus . Combining the last two categories gives versus , an employed-minus-non-employed difference of about 11.26 percentage points. That threshold comparison is a descriptive summary of the six-category table, not a replacement for the original omnibus test or a newly declared prespecified endpoint. It does not assign equal spacing to the six frequency categories.
Here the row counts, column counts and grand total are additive. Under the null hypothesis of employment–use independence, a contingency table has statistical degrees of freedom. The Pearson chi-squared statistic recomputed from the cells is , agreeing with the printed value, and its p-value is about . The likelihood-ratio test statistic gives . Both reject independence at the conventional 5% and 1% significance levels under the sampling assumptions. The minimum expected frequency, about , gives no sparse-cell warning for this table. The tests compare whole category distributions; they do not by themselves identify one category as the source of the association or establish its causal direction.
Cramér's V is . The generalized phi coefficient coincides with it for this two-row table, while the contingency coefficient is about . These are modest magnitudes; a small p-value does not make the relationship large or useful for individual prediction. The employment–use association could change after conditioning on age or other covariates, and the sample excludes cases without recorded use. Relative to the employment margins in Figure 1, the omitted complete-case counts are non-employed and employed, or about and of those groups. Different missing fractions alone do not identify the missing-data mechanism, but they rule out treating complete records as automatically representative of everyone.
The count-based Goodman and Kruskal's gamma is
With the employment categories ordered non-employed then employed and use ordered from never to more than daily, this positive value means concordant pairs outnumber discordant pairs among pairs untied on both variables. It is not a 16.9% increase in a person's use and is not a causal effect. Reversing one ordering reverses its sign. Excluding ties can make gamma appreciably larger than tie-adjusted measures.
For use as response and employment as predictor, the cells give Somers' D about , Kendall's tau-b about and Stuart's tau-c about . The printed Somers value and tau-b should not be presented as verified calculations: the table prints second-variable-only ties, whereas its cells give . The other four pair classes agree with the cells; the printed five classes sum to , not . The source does not establish an alternative tie convention that repairs those ordinary identities. The direction remains a weak positive association under either description, but the exact measures require coherent pair counts.
Modal prediction provides another perspective. Without employment information, predicting the globally most frequent use category, never, makes errors. Predicting a separate modal use category in each employment group makes errors. Thus Goodman and Kruskal's lambda for use given employment is : about a 1.97% reduction in modal-classification errors. For employment given use the corresponding reduction is . These identify the targets explicitly; the source's row-dependent/column-dependent labels should not be used to reverse the target interpretation. The two small numbers show why an independence test can be significant while coarse modal prediction improves very little. The supported overall finding is a modest positive association among observed respondents, requiring conditional analysis and a missing-data qualification before broader claims.
Test the null hypothesis against the alternative hypothesis that the two rate parameters differ. Under , the pooled maximum-likelihood estimate is . Under the alternative, the estimates are and .
In the likelihood-ratio test statistic, the data-only terms cancel, and both fitted models have total . Consequently,
The alternative hypothesis adds one parameter, so Wilks theorem gives an approximate chi-squared distribution with one degree of freedom. Do not reject the common-rate model at the 5% level, since . The corresponding approximate p-value is . The fitted expected values are and days, but four observations per group supply little evidence that the underlying expected values differ; failure to reject does not establish equality. The chi-squared distribution calibration is asymptotic and should be treated cautiously for these small samples.
Under the diagonal covariance restriction, the profile log-likelihood separates into terms,
Differentiating each term gives the restricted maximum-likelihood estimator . Both fitted trace terms equal , so the likelihood-ratio test statistic is
where is the sample correlation matrix. The statistic is nonnegative by the Hadamard inequality; large values indicate dependence. Equivalently, the likelihood ratio is and rejection is for small values of this ratio.
For fixed and a positive-definite true covariance, the Wilks theorem says that twice the maximized log-likelihood difference for nested regular models converges under the null to a chi-squared distribution with degrees of freedom equal to the dimension difference. The unrestricted covariance has parameters and the restricted covariance has ; the unknown mean has the same parameters in both. Therefore the Gaussian covariance diagonality likelihood-ratio test of asymptotic level is
Within the multivariate normal distribution, diagonal covariance also means independent coordinates.
A Bartlett correction improves calibration of a regular likelihood-ratio test statistic , whose null limit is for tested restrictions. If
the corrected statistic is . Its null mean is and it is compared with the same limiting chi-squared distribution. The coefficient is model-specific, may involve nuisance parameters, and can be calculated from likelihood cumulants or a suitable null simulation; substitution must respect the asymptotic regime.
Under the regular higher-order likelihood expansions and identities that establish Bartlett correctability, this rescaling removes the leading distributional error and can give chi-square calibration error. Matching one moment by itself does not prove that assertion for an arbitrary statistic, and nonregular boundary or singular models need different treatment.
For illustration, testing a normal variance with unknown mean gives with . The gamma logarithmic moment yields
Thus the Bartlett correction for a normal variance with unknown mean uses , not the correction for the different known-mean model. This example also distinguishes the relative coefficient from the full divisor .
Under the unrestricted model, insert the maximum-likelihood estimates . Under the diagonal-covariance restriction, the quadratic form is minimized over the mean at , and the remaining objective separates over the diagonal entries:
Differentiating in gives ; the derivative changes from negative to positive there. Put . The fitted trace term is under either model, since . Consequently the likelihood-ratio test statistic is determined by
This is the Gaussian diagonal-covariance likelihood-ratio test. Reject for sufficiently small , equivalently for large . Under the regular large-sample calibration, Wilks theorem gives , since diagonality removes that many free covariance parameters. The exact critical constant can instead be obtained from the null distribution at the actual sample size.
For , write the sample correlation coefficient as . Then , so the likelihood-ratio test rejects for large , not merely for large positive . Under the null, the two variables have a bivariate normal distribution and are independent, and the exact test is
Indeed, condition on the centered first-variable observation vector. Decompose the second centered Gaussian vector into its component along that direction and the -dimensional orthogonal complement. Their squared lengths give independent and variables. Their ratio shows that has Student's t-distribution with statistical degrees of freedom.
Let be a regular likelihood-ratio test statistic for smooth restrictions, so its leading null law is . Suppose a higher-order calculation gives . The Bartlett correction rescales the statistic:
Its mean is , eliminating the first-order mean error. In regular likelihood models satisfying the usual Bartlett expansion, the same scaling removes the leading distributional error against the chi-square reference law, leaving an error for fixed tail probabilities. Matching a mean alone would not establish this distributional conclusion for an arbitrary statistic.
The coefficient depends on the model, null restrictions and nuisance parameters; it can be obtained from higher derivatives and cumulants of the log-likelihood, or estimated by null simulation when an analytic expression is inconvenient. Nuisance parameters require their appropriate null values or estimates. A correction improves finite-sample calibration within regular asymptotic theory; it does not turn a boundary-parameter or unidentifiable problem into a regular chi-square problem.
For independent binomial distributions, the log-likelihood, up to known binomial coefficients, is
The saturated statistical model maximizes each term at . Under the logit link, the fitted probabilities are . Subtracting the fitted log-likelihood from the saturated log-likelihood gives the binomial deviance
A zero-count summand uses the continuous convention . For the restricted model, replace by to obtain . Since the saturated likelihood cancels, is the likelihood-ratio test statistic. For the nested restriction setting coefficients to zero, Wilks theorem gives the asymptotic chi-squared distribution under regularity and an interior true parameter; reject for a large difference.
For the six anther cells, gives a common success probability, gives a separate probability for each storage condition, gives a common intercept and a log-force slope, and gives storage-specific intercepts with a common log-force slope. Their parameter counts are , so their residual statistical degrees of freedom are . In , storage has a constant effect on log odds; multiplying force by multiplies the odds by in either storage group.
The relevant nested likelihood-ratio tests at the level are:
The two two-parameter models and are not nested, so their deviance difference has no ordinary nested chi-squared distribution calibration. The preferred parsimonious model is , with a storage effect and no log-force effect. Its deviance goodness-of-fit test is acceptable: on four statistical degrees of freedom. The common-probability model also passes its separate goodness-of-fit comparison, , but this does not contradict the relative evidence for adding storage: the two tests assess different null hypotheses. These are large-sample approximations; sufficiently large expected successes and failures, not merely the number of anthers, underpin their calibration.
A useful full statement is the rank-sum form of Cochran's theorem. Let and let be real symmetric matrices satisfying . Put and . Then , and the following conditions are equivalent: the ranks sum to ; the are orthogonal projection matrices with mutually orthogonal ranges; and the are independent, with . A rank-zero form is identically zero. In particular, the usual projection version of Cochran's theorem partitions the squared length of a standard normal vector into independent chi-squared distributions.
Here is a proof which also explains the rank condition. Let . Since every vector satisfies , the spaces span . Therefore their dimensions sum to at least . If they sum to , their sum is a direct sum, so every vector has a unique decomposition into vectors belonging to the . For , the identity is one such decomposition, while the decomposition with just in position and zero elsewhere is another. Uniqueness gives . Thus
A symmetric matrix with this idempotence is an orthogonal projection matrix. Its different ranges are orthogonal: for , , their inner product is . Choose an orthonormal basis for each range and concatenate them. The resulting change-of-basis matrix is an orthogonal matrix. In these coordinates, each is the sum of squares of the coordinates belonging to its range.
The transformed multivariate normal distribution still has density proportional to , which factors into the standard normal densities of its coordinates. The coordinates are independent, so the disjoint groups of squared coordinates give independent chi-squared distributions of the asserted degrees of freedom. This proves the forward implication. Conversely, if the have the asserted chi-squared laws, then , while has expectation . Taking expectations yields . This completes the equivalence and the proof of Cochran's theorem.
For the application, specify a normal linear model
with fixed full-column-rank design matrix of size , , unrestricted , and unknown . Test against , where has independent rows, , and is specified. The null contains an affine space of means of dimension , whereas the full mean space has dimension .
Let be the ordinary least squares and maximum-likelihood estimate in the full model, and write . The constrained estimate follows by minimizing the residual squared length under :
Indeed, and the correction is the required constrained projection in the inner product. The least-squares normal equations give the Pythagorean decomposition
Consequently the explicit residual quantities in the likelihood-ratio test statistic are
Here is the full-model residual sum of squares, and is the increase caused by imposing the null restrictions.
To see the geometry behind Cochran's theorem, choose any with , and let project onto and onto . For ,
The projectors and are orthogonal and have ranks and . Under , the mean of belongs to , so both of these projectors annihilate it. Thus Cochran's theorem gives
The nuisance variance cancels in the nested-model F-test statistic
Since the likelihood-ratio test statistic is
it is a strictly increasing function of . Therefore an exact level- likelihood-ratio test rejects when , where the right-hand side is the upper reference quantile of the F-distribution. This calibration is exact under the normal linear model, rather than an asymptotic chi-squared replacement.
Assume , so the residual sum of squares is positive almost surely. Write and . The log-likelihood is
The decomposition shows that, at every fixed positive variance, its constrained maximum-likelihood estimate of the mean is . Substituting this mean and differentiating with respect to the variance gives
The denominator is required by maximum likelihood estimation; is the unbiased variance estimate, which is a different estimator.
Under the null variance , maximize over the same mean . Subtracting the null maximum log-likelihood from the unrestricted maximum gives the likelihood-ratio test statistic
By Cochran's theorem, the residual sum of squares in a normal sample satisfies under the null. Set , so . Then
The normal mean is a nuisance parameter, but this null law does not depend on it.
A Bartlett correction removes the first-order discrepancy between the null mean of a regular likelihood-ratio test statistic and the degrees of freedom of its limiting chi-squared distribution. In the convention used here, if the limiting degrees of freedom are and
then is the Bartlett correction coefficient, also called the Bartlett correction factor, and the Bartlett-corrected likelihood-ratio statistic is . Its null mean is . The finite- divisor is , rather than itself. There is one restriction on the variance here, so .
Expand the logarithm around and use the permitted termwise asymptotic integration:
Using the supplied raw moments of the chi-squared distribution and expanding gives
For instance, and give the first formula after subtracting . The same binomial expansion, using the raw third and fourth moments, gives the other two formulas.
We must justify why higher moments cannot change the coefficient. Represent for independent standard normal variables, and put . Each is centered and has all absolute moments finite. With , one has . The supplied centered-sum bounds say, for each fixed integer ,
Also and . Therefore, for every fixed , expanding gives
These are bounds on the absolute values of signed moments; the odd-moment estimate must not be misread as a bound on . In particular, each fixed Taylor term of degree has or smaller. Combined with the question's permission to integrate the asymptotic expansion term by term, this controls the higher-order contribution at the required order. It does not require a globally convergent Taylor series for every realized .
Substituting the first three moment formulas now gives
Thus the Bartlett correction for a normal variance with unknown mean is
Its null mean is , and the usual reference law is . Keeping the estimated mean's loss of one residual degree of freedom, and using the maximum-likelihood variance divisor , are both essential to the coefficient .
Let denote the maximized log-likelihood in the saturated model, with one fitted mean per observation. With known dispersion, define the deviance of a fitted model as ; for an exponential-dispersion convention that scales deviance by the dispersion , divide that scaled quantity by in the following test.
Let be the fitted deviances under the null and full models. Their difference is the likelihood-ratio test statistic
Under the regular identifiable interior null hypothesis, Wilks theorem gives the limiting distribution. Reject for an observed difference above its chosen upper-tail critical value. This concerns the difference of fitted model deviances, not simply the full-model deviance compared with zero.
For a Poisson regression, the means are and . Saturation sets , taking the limiting value at . Consequently the Poisson deviance is
with . The intercept score implies at a finite fit, although retaining that term makes the individual deviance contributions clear.
For with small, expand . The linear term cancels and the result is . Therefore
the Pearson chi-squared statistic. The approximation requires adequately large fitted counts and small relative residuals; it is not an identity for sparse observations.
The second logistic regression adds while retaining the first lag and baseline covariates. The models are nested under . Their likelihood-ratio test statistic is the reduction in binomial deviance,
Under the null and regular large-sample conditions for the correctly specified conditional likelihood, this has an approximate chi-squared distribution with one statistical degree of freedom. Since , reject at 5%; the approximate p-value is . Prefer the two-lag model to the one-lag model. Its additional lag captures statistically useful information in the history.
Under , the seven free covariate coefficients all equal zero. The likelihood-ratio test statistic is
The larger fit has ten free statistical parameters, compared with three in the constant-rate fit, so the reference chi-squared distribution has seven statistical degrees of freedom. Its 95th percentile is . Therefore reject at 5%; the p-value is approximately , and the covariate model is preferred. The two constrained sex coefficients add no free statistical parameters.
For the dementia-to-death arrow, the hazard ratio for higher versus lower education is , with approximate 95% confidence interval . Thus higher education is associated with a roughly 77.5% lower fitted death transition intensity, conditional on diagnosis age; the interval excludes one. This is an observational association and is not a direct multiplicative statement about death probability.
Each additional year of age at diagnosis multiplies the dementia-to-death transition intensity by , with confidence interval . The estimate suggests an increase, but the interval includes one, so this individual age coefficient is not significant at 5%. Sex has hazard ratio one for this transition by the model's imposed constraint. The output supplies no estimated sex effect or test of that constraint for this arrow. The nonzero sex coefficient for must not be mistaken for a sex effect on .
Use one joint hypothesis test for . Fit the unrestricted model with statistical parameters , where and for treatment indicator . Refit under , estimating the two common baseline intensities; do not fix them at their unrestricted estimates. The likelihood-ratio test statistic is
Under regular identifiable positive-rate models, sufficient independent patient trajectories, and the null hypothesis, Wilks theorem gives two degrees of freedom because two coefficients are constrained. Reject if exceeds the chosen upper chi-squared distribution quantile. Alternatively a two-dimensional Wald test uses , including the off-diagonal covariance. Two separate tests do not provide this single calibrated assessment. The point estimates alone cannot produce a numerical p-value without fitted likelihoods or a coefficient covariance matrix.
There are two defects. The mixed fit supplies a restricted maximum likelihood, whereas the ordinary fit supplies an ordinary log-likelihood, so their difference is not a likelihood-ratio test statistic. Also, lies on the boundary of ; the usual Wilks theorem does not give a null law.
A valid approach first refits the mixed model by ordinary maximum likelihood estimation, setting REML to false, and fits the same fixed effects under . For , maximize
over , and separately over with . Set .
For finite-sample calibration, use the location-scale invariant simulation test for a Gaussian variance component. With the actual fixed, simulate independent vectors , refit both models by ordinary maximum likelihood estimation to each, and calculate in exactly the same way. Under , . Translating by a vector in the column space of and multiplying by a positive scalar preserves the statistic: both maximized log-likelihoods acquire the same scale constant. Thus this simulation has the correct null law without knowing or . A conservative Monte Carlo p-value is
In the usual regular limit with increasing independent groups, a variance-component likelihood-ratio test at a boundary instead uses : for , its approximate tail probability is , and at the nonrandomized p-value is one. This approximation is not an exact guarantee for sixteen rats. Alternatively one can compare consistently defined restricted likelihoods with the same and simulate their restricted-ratio null distribution, as in the RLRsim documentation.
Write for the request count on day . Both fits are Poisson regression models with independent
In model 1,
where the variables are indicator variables for winter, weekend, bank holiday, and low or medium pollution; non-winter weekdays that are not bank holidays and have high pollution form the baseline. Model 2 imposes
retaining only winter and weekend effects.
The models are nested, and the likelihood-ratio test statistic is the decrease in residual deviance,
There are three restrictions. By Wilks theorem, under this statistic is asymptotically a chi-squared distribution with three degrees of freedom. Since
we reject model 2 at the level in favour of model 1.