F-statistic Created 2026-09-29 Updated 2026-10-14
An F-statistic is a ratio of two variance estimates. Under the null hypothesis of an F-test, suitably independent scaled sums of squares make this ratio follow an F-distribution.
Lack-of-fit F-test 2026-10-14
For independent normal responses of common variance at distinct predictor settings, a rank- normal linear model has residual degrees . The saturated setting-mean model has parameters and pure error degrees . Splitting orthogonal residual spaces gives lack of fit degrees . Under the fitted mean model, the two squared lengths divided by the common variance are independent chi-squared variables; their ratio of mean squares has the F-distribution shown. This test is unavailable without repeated settings or positive lack-of-fit degrees.
For independent samples from normal distributions with separate unknown means, test equal variances against . Profiling the means gives sample means. Under the null the variance maximum is ; the separate maxima are and . If the latter obey the proposed order, their likelihood quotient is
It decreases strictly as increases. Otherwise the ordered alternative maximum lies on the equal-variance boundary and the quotient is one. Under the null, Cochran's theorem gives independent chi-squared residual sums with degrees , so rejection is in the upper tail of the displayed F-distribution statistic, calibrated at the desired significance level.
Write for the all-ones vector and set
The centering assumption makes . Thus the full normal linear model has fitted-value orthogonal projection , and its residual sum of squares is . Assume , as is needed to estimate the unknown error variance from residuals.
For the null that all slopes vanish, the reduced fitted value is , with residual sum of squares . The F-test is
Reject for an upper-tail value exceeding the quantile of this F-distribution. The required theorem is Cochran's theorem: for an isotropic normal distribution, projections onto orthogonal subspaces are independent, and the squared norm on a rank- subspace divided by has a chi-squared distribution with degrees of freedom. Here the null makes the projected mean in zero, so , independently of .
Let be the numbers of columns in the two predictor blocks. To test the first block while retaining the second as nuisance, form
The partial F-test for nested linear models is
Again reject in the upper tail. The difference of the nested fitted-value projections has rank , is orthogonal to the full residual projection, and annihilates the null mean, which gives the same independent chi-squared argument. If a block has no columns, the corresponding test is vacuous.
The phrase orthogonal statistical parameters refers to zero cross-block Fisher information, not to the numerical parameter vectors being perpendicular. In this model the cross-block information is , so the orthogonal coefficient blocks in a centered normal linear model condition is
Then the two fitted subspaces are orthogonal, the block least-squares estimators have zero covariance and are independent because they are jointly Gaussian, and each block's extra sum of squares is unchanged by including the other block. Centering also makes both blocks orthogonal to the intercept.
The P-star approximation describes the sampling density of a regular maximum-likelihood estimator in sample coordinates consisting of the fitted parameter and a suitable ancillary statistic . For a -dimensional parameter, write for the log-likelihood expressed in these coordinates, and for the fitted observed information. The approximation is
The determinant factor supplies the local volume scale, while the exponential retains the full likelihood ratio, rather than replacing it by a quadratic. The normalizing constant is chosen by integrating over the fitted-parameter coordinates; its leading regular large-sample value is . These ingredients arise from a statistical saddlepoint approximation. Their use requires an interior, locally unique fit, nonsingular information and suitable smoothness; an ancillary statistic specifies the conditioning surface when the fit alone does not exhaust the relevant sample coordinates. In a regular model the unnormalized leading expression has relative error of order locally; normalization and conditioning matter for refined inference. It is not a universal exact density. Under a smooth one-to-one parameter transformation, the Hessian at the fit transforms without a score term, so its determinant supplies precisely the density Jacobian determinant. This proves the invariance of the construction under one-to-one changes of statistical parameters.
Here put and . The log-likelihood, apart from a data-only constant, is
The two score equations give
The sample sums form a sufficient statistic, and there is no need to retain an additional ancillary in calculating their joint density. Inverting the fitted coordinates gives and . With parameter order , the fitted observed information is
Also,
Thus the required joint P-star approximation is
To integrate out , substitute in
Taking and rearranging the powers yields
The beta function identity therefore gives
Both normalized approximations are actually exact. To check the joint assertion independently, and have independent gamma distributions with shape and rates and . Their joint density is . The inverse-coordinate Jacobian determinant is
which reproduces the normalized joint expression. This is the P-star density for two exponential rates; its marginal gives the stated F-distribution. Stirling's approximation gives , so using only the leading normalizer retains the exact shape but not its exact total mass.
The original PDF's displayed density constant is missing a square on . Its printed expression integrates to , rather than one in general. The normalized density above is the one consistent with the stated F-distribution.
Assume the two normal samples are independent. Write , , and let denote their residual sums of squares about the respective sample means. The joint likelihood function, apart from its constant factor, is
where , . For every fixed variance pair the means maximize this likelihood at , because , and likewise for .
Under equal variances, differentiate the profiled log-likelihood to obtain . Without the order constraint, the separate variance maxima are , . If they lie in the alternative. If their order is reversed, maximizing over puts the optimum on the equal-variance boundary. These assertions also follow by strict concavity in the precisions .
Thus the one-sided likelihood-ratio test for two normal variances uses the quotient of the null maximum to the maximum over null and ordered alternative:
To identify the rejection direction, put . Up to constants, . Its derivative is , negative on the ordered branch . Hence small likelihood ratios mean a large sample variance ratio.
The null law must account for estimating both means. By Cochran's theorem, and are independent random variables with chi-squared distributions of 5 and 20 degrees of freedom. Consequently the exact null statistic is
It is an increasing multiple of , so an upper-tail critical region is the likelihood-ratio rejection region. The observed statistic is . The supplied 95th percentile is 2.71, so
The F-distribution degrees of freedom are , not , although the variance maximum-likelihood estimates themselves have denominators .
The S-Plus input and the data table differ in one entry: the former uses for the first year in the second male age group, whereas the table has . The displayed coefficients are reproduced by the software vector with , so that is the input analysed here. Using instead would give a different fit, including an intercept of rather than .
The factor grid has rows. Its first factor varies fastest, so the five years run within each age group, and the age groups run within each sex. All three predictors are regression factors: in particular the year coefficients are category contrasts, not a fitted linear slope in calendar time. Under reference-level coding, take the first year, youngest age group and men as the reference levels in a regression factor. Write for women and for men, and for the other year and age indicators. The normal linear model is
The star in the formula includes both main effects and their statistical interaction. There are twelve coefficients: an intercept, four year contrasts, one sex contrast, three age contrasts and three sex-by-age contrasts. Year effects are assumed common across all sex-age combinations; there is no year interaction term. Independent errors with common variance are additional assumptions of the reported exact tests.
The least-squares estimator is , where has rank twelve. Under the normal linear model,
and these quantities are independent. This standard normal-projection theorem gives and estimated coefficient standard errors . A coefficient estimate divided by its standard error has a Student t-distribution with 28 degrees of freedom under its zero-coefficient null. These are the printed t statistics and two-sided p-values; a printed zero is rounding, not a probability of exactly zero. The option suppresses the coefficient-correlation display.
The fitted intercept is the expected percentage for the reference sex, age and year. Relative to that year, the year changes are percentage points. The last two are individually significant at the conventional five-percent level; the first two are not. The sex coefficient is the female-minus-male difference in the youngest group. The male age changes are points. Adding the three interaction term coefficients gives the female age changes . Thus the sex gap shrinks with age. An individual insignificant interaction term coefficient does not justify deleting the whole interaction: the joint partial F-test for the three interaction terms gives on degrees of freedom, with .
The regression residuals are observed minus fitted percentages; their printed five-number summary describes their spread. Direct calculation gives , so the residual standard error is
The coefficient of determination is . The overall F-test compares all eleven non-intercept coefficients with zero:
Under the null it has an F-distribution on degrees of freedom; its very small p-value shows substantial explained variation. This does not independently validate the Gaussian error assumptions. Survey percentages can have different sampling variances and correlations, and the survey denominators and design are not supplied. The output's exact inferential interpretation is conditional on the stated normal linear model.
The final command makes an interaction plot, not another regression fit. Its points are arithmetic averages over the five years for each sex-age combination. It draws two decreasing, nonparallel lines, with coordinates
Their gaps are percentage points, illustrating the sex-by-age statistical interaction. The average uses the software vector's disputed entry, consistently with the displayed fit. These are means of percentages, not denominator-weighted pooled prevalence estimates.
Figure 1.
Sex-by-age interaction plot averaged over years, using the printed software input
. Details.
Write the binary incidence matrix of a set system as to avoid confusing it with a sample size. Then
counts the number of blocks containing treatment , and for , counts blocks containing both treatments. The displayed structure therefore makes every treatment replication equal to and every pair concurrence equal to .
Assume the usual nonempty block design, with and . If , any block containing one treatment contains every other treatment: otherwise that treatment's replication would exceed its concurrence with the omitted one. Every block is consequently complete, so and . With random allocation within blocks this is a randomized complete block design. If , the design is a balanced incomplete block design. Counting partners of a fixed treatment in its blocks gives
For , gives , hence . Moreover has eigenvalue on the -dimensional zero-sum subspace and eigenvalue on the constant direction. Thus , while . This proves , the Fisher's inequality for block designs. The case allows singleton blocks; their lack of connectedness prevents general treatment comparison after block adjustment, but does not invalidate the rank inequality.
First ignore the day information and use a one-way normal linear model with five group means and independent errors of common variance. There are observations. The analysis of variance has treatment, residual and corrected-total statistical degrees of freedom , respectively. The mean squares in ANOVA give
Under equal treatment means this has the F-distribution with degrees. It exceeds the given upper critical value , so the unblocked analysis rejects equality at .
The actual day allocation omits a different treatment on each of the five days. Hence it is a balanced incomplete block design with
Every pair occurs on exactly the three days omitting neither member. In the additive two-way analysis of variance, use an intercept, four independent treatment contrasts and four day contrasts. The design is connected, so the model rank is and its residual has statistical degrees of freedom. Day effects and treatment effects are not orthogonal, because a different treatment is absent each day; the unadjusted treatment sum of squares cannot be used for the adjusted test.
Enter days first and then treatments. The supplied sequential sums of squares give
The day, treatment-after-day, residual and corrected-total statistical degrees of freedom are . Under the additive normal linear model and the null of equal treatment effects, the adjusted numerator and residual squared lengths are independent chi-squared quantities, so the ratio has the F-distribution with degrees. It is below even the given critical value . After accounting for days there is no significant treatment difference at either or . This inference assumes independent homoscedastic normal errors and an additive day effect; with one observation per observed treatment–day cell, unrestricted interactions cannot also be fitted.
scan reads the numerical prices, including the three missing-value markers, into a vector. The data must be read row by row for the subsequent factor construction to match them. The sample size available for analysis is therefore , rather than . The numerical summary describes the observed prices: the sample median is £43.54 and the sample mean is £46.94. The upper tail, particularly the boots, raises the sample mean above the sample median. These summaries mix very different products and are not adjusted country comparisons.
The two character scans create labels. gl(8,5,length=40,labels=item) makes a regression factor with each of eight item labels repeated five times. gl(5,1,length=40,labels=country) cycles through the five country labels once for each item. For a regression factor and numerical response, the two plot commands produce grouped box plots. The country box plots suggest lower US prices, while the item box plots show particularly expensive boots and inexpensive cardigans. They are descriptive displays of this small basket, with different item compositions where prices are missing; they cannot separate country effects from item effects.
The first lm fits an additive two-way analysis of variance:
The constraints are R's usual treatment coding. The normal linear model used for the printed tests assumes independent errors with common variance and approximately a normal distribution, and no item-by-country interaction in the mean. Missing prices are omitted, leaving responses and independent mean coefficients. Thus the residual degrees of freedom are . This deletion is defensible for the conditional price model when missingness does not depend on the unobserved error after conditioning on the two factors; the output itself does not establish such a missing-data mechanism.
The anova tables report sequential sums of squares, rather than order-independent adjusted effects. If are the residual sums of squares from the intercept-only, country-only, item-only and additive fits, the first order allocates to country and to item. The second order allocates to item and to country. Both allocations sum to the same total explained sum of squares, and both end with the same residual sum of squares . The three missing combinations destroy balanced factorial orthogonality, so the allocation changes with order. To test country after allowing for items, use the country row in the second table; to test item after allowing for countries, use the item row in the first table. The first-entered rows do not supply those adjusted tests.
Each mean square in ANOVA divides its sum of squares in ANOVA by its statistical degrees of freedom, and each printed F-statistic divides that mean square in ANOVA by . In particular, the adjusted country partial F-test has
with an reference F-distribution and p-value approximately . The adjusted item partial F-test gives on statistical degrees of freedom. Both factors contribute strongly under the additive normal linear model. The larger item sum of squares in ANOVA measures the much greater differences between these products, but is not evidence that every pair of items differs significantly.
The intercept is the fitted UK price for the reference jeans, not their observed price and not the overall sample mean. Each country regression coefficient is its adjusted price difference from the UK, assumed common across items: Sweden is £5.224 lower, France £10.708 lower, Germany £7.676 lower and the US £21.328 lower. Each item regression coefficient is its adjusted difference from the reference jeans, assumed common across countries. Thus the fitted UK boots price is , and the fitted US boots price is .
The coefficient standard errors come from , where and is the design matrix. Dividing each estimate by its standard error gives the displayed Student t-test statistic, with statistical degrees of freedom. The stars summarize the corresponding two-sided p-values. The individual tests compare each indicated country or item with its reference level, conditional on all other additive terms; they are neither tests of every pairwise comparison nor a simultaneous confidence interval procedure. In particular, Sweden's p-value provides weaker evidence than the other country contrasts, and does not establish equality with the UK. The intercept test has little substantive relevance, and interpreting many individual stars also raises multiple hypothesis testing issues.
The residual standard error measures unexplained prices in pounds. With total corrected sum of squares , the coefficient of determination and adjusted coefficient of determination are
Much of this impressive fit is due to the large differences between items. The overall F-test compares the additive fit with a constant mean: on statistical degrees of freedom. It tests that all eleven non-intercept coefficients vanish, not that the additive model is adequate. Regression diagnostics should examine regression residuals, changing price variability across items and possible interaction. Percentage differences may be more plausible than common pound differences, motivating a natural logarithm of price. No random sample of countries or products, and no independent replication of a price within a cell, is supplied; broad claims about all designer goods or the causes of country differences require more than these conditional tests.
Finally, Item*Country expands to both main effects and their full interaction. A cell-means parameterization has one separate fitted mean for every observed cell. With one response per cell its design matrix has row matrix rank , while the full layout nominally has coefficients. Three coefficient combinations are aliased because their cells are missing. This is saturation of an unreplicated two-factor regression: every observed price is fitted exactly and the residual degrees of freedom are zero. The final fit has zero residuals, and no residual-based estimate of the error variance or ordinary interaction significance test. The printed numerical summary will mark three coefficients unestimable; coefficient standard errors, tests and adjusted involve undefined division by zero, potentially appearing as NaN or Inf according to numerical roundoff. Perfect interpolation here is a consequence of a saturated statistical model, not evidence for a superior predictive model.
Assume an independent Gaussian sample, positive-definite population covariance, and . Define the sample mean and unbiased sample covariance matrix by
The standard test is based on Hotelling's T-squared statistic
Reject the null hypothesis for large values. Under the null its exact distribution is
The factor uses the unbiased, divisor- covariance convention. Normal-sample theory makes independent of the residual covariance, whose whitened version has a Wishart distribution; this yields the stated F-distribution. The condition gives invertibility of almost surely and positive denominator degrees of freedom.
This is also the likelihood-ratio test. To see the connection, put and . The maximized covariance estimates under the unrestricted and null models are and , respectively. The determinant identity for a rank-one update gives
Thus the likelihood ratio is , decreasing in . The term best is understood here as this standard likelihood-ratio, affine-invariant procedure; a two-sided multidimensional alternative does not specify a single direction to optimize power against.
For the transformed sample , with the prescribed nonsingular coordinate transformation, we have
Consequently
This proves the affine invariance of Hotelling's statistic. The statistic, its p-value and its test decision are unchanged by a nonsingular affine transformation, provided the null mean is transformed with the data. Changes of units and rotations are included.
Put , . Orthogonal projections of the Gaussian error give independent variables
Hence the exact confidence set is the ellipsoid
Here denotes the quantile of the F-distribution.
Let be the fit with observation removed, when that reduced design retains full rank. Cook's distance is
where is its residual and is its leverage. Thus measures the deleted estimate's distance from the full estimate in exactly the metric of the confidence ellipsoids. The deleted estimate lies on the confidence contour whose quantile equals ; this is a geometric influence diagnostic, not an assertion that itself has an law.
For , , so deletion moves the estimate outside the 50% confidence ellipsoid but inside the 90% one. The observation warrants investigation for influence: the shift is substantial, though the supplied figures do not justify calling it outside the 90% region. The reciprocal and the approximate chi-square figures are unnecessary.
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.
Use the unbiased sample covariance matrix
and assume is positive-definite and , so is invertible almost surely. For a nonzero fixed direction , the observations have mean and variance . Their squared Student t-test statistic for the projected null mean is
Put . The Cauchy-Schwarz inequality gives
with equality when is proportional to , if . For every projected statistic is zero. Maximizing the squared discrepancy over directions therefore gives Hotelling's T-squared statistic:
This uses the squared generalized Rayleigh quotient. The preliminary formula on the printed cover has an unsquared numerator and is not valid as written: setting makes that ratio for , so it is unbounded. The displayed Cauchy-Schwarz argument supplies the needed corrected identity independently.
Under the null, let and . Then , , and are independent. To see these sample properties, apply an orthogonal transformation to the observation indices with first row . Its first centered row is ; its other rows are independent residual contrasts, independent of the first. Their outer products sum to , establishing the Wishart distribution and independence.
Since , use the supplied Gaussian-Wishart quadratic-form law with to obtain
Thus a level- test rejects when this scaled statistic exceeds the quantile of the F-distribution. The Gaussian-Wishart law requires independence; it holds here because of the orthogonal sample decomposition. Its printed use of instead of the introduced is a notational slip. A fixed-direction Student law alone would not calibrate the maximized statistic, because its maximizing direction depends on the sample.
Transform each observation to . If has full row rank , the transformed sample is multivariate normal with mean and positive-definite covariance matrix . Its sample mean is and its unbiased sample covariance matrix is . The Hotelling test of linear hypotheses therefore uses
Here is required. Reject for a large scaled statistic using the relevant upper F-distribution quantile. If the rows of are dependent, choose a basis for their row space, use that basis as the contrast matrix, and replace by its rank . The null hypothesis is unchanged, but redundant contrasts must not be treated as independent dimensions. Rank zero gives no restrictions and hence no nontrivial test.
At equal spacing , the adjacent increments of an affine mean profile are all . Their differences are therefore zero. Define the matrix whose row associated with the interior time has coefficients in columns . Then
Conversely these equations make all adjacent first differences equal, so is affine in , equivalently affine in the equally spaced times. Thus the restriction is exactly , not just a necessary condition. Its null space has basis and , so has rank .
For and , the second-difference test of a linear mean profile is the Hotelling test of linear hypotheses with
Reject the affine-profile hypothesis when the scaled statistic exceeds its level- upper F-distribution critical value. This removes the nuisance intercept and slope without estimating them separately.
For unequal ordered distinct times, put and replace each second-difference row by the adjacent-slope contrast
Its three coefficients are , and . Vanishing means all adjacent slopes agree, again giving null space and rank . Use this new in the same statistic and null distribution. For , every mean profile at distinct times is affine, so there is no lack-of-linearity restriction to test.
Let be the flight distance in millimetres for paper level , launch-angle level , design level and replicate , where and . The full factorial design is fitted by the normal linear model
The assumptions are independent errors with a common variance and normal distribution, and the displayed factor-combination mean structure. The corner-point constraints are
and whenever at least one index equals . Thus the eight free mean coefficients are . These treatment coding coefficients are comparisons at the other factors' reference levels, rather than necessarily averaged main effects.
To test the three-factor interaction term, compare the full model with the model retaining all main effects and all two-factor interactions. The null hypothesis is , against a nonzero value. Removing it increases the residual sum of squares by and removes one parameter. With eight residual degrees of freedom, the nested-model F-test gives
There is no evidence that this three-factor interaction is needed. This does not establish that all two-factor interactions vanish: the paper-design interaction is substantial.
The stepAIC command performs stepwise selection by the Akaike information criterion. Its upper scope is the full factorial model and its lower scope is the intercept-only model. Starting from the full model, it compares admissible additions and deletions, preserving the hierarchy of interaction terms, and chooses changes that reduce the Akaike information criterion. With the supplied scope its default search permits both directions. For these Gaussian fits the displayed criterion, up to constants common to all models, is , where counts mean coefficients. The first deletion changes it from to : the small increase in residual sum of squares is outweighed by removing a parameter. This is a greedy model selection procedure, not an exhaustive search or a sequence of fixed-level hypothesis tests. The command's arguments are described in the MASS documentation.
For the selected model, let and . Then
independently between flights. It has no angle term. The maximum-likelihood estimates of its mean coefficients are also obtained by ordinary least squares:
For example, the four fitted means are just the four paper-design cell means, each averaging four flights over the angle levels. With , the variance-covariance matrix of the coefficient estimates is . Its diagonal gives the displayed standard errors; their ratios are , with mm.
The final line of summary(model2.lm) is the joint nested-model F-test of , comparing this four-parameter model with a common mean. Its statistic is
with F-distribution under the fixed-model null and P-value . Thus the selected paper-design terms jointly improve the fit substantially. The coefficient of determination means they account for about of the observed centred variation. These nominal inferential summaries do not adjust for the preceding model selection on the same data.
Using the unrounded fitted means gives
in millimetres. Hence choose the high-performance design with the lighter paper; the fitted model leaves both launch angles tied, with expected distance about mm. A preference for one angle is not supported by this selected model. The strong paper-design interaction reverses the design comparison: the simple design is better on heavy paper, whereas the high-performance design is better on light paper. Consequently a single design effect averaged over paper types would conceal the main result. There is little evidence here for an angle effect, and considerable flight-to-flight variability remains.
Before fitting, inspect raw-distance dot plots for all eight factor combinations, and interaction plots of cell means against design, with separate lines for paper and panels for angle. With only two replicates per cell, showing individual observations is more informative than elaborate box plots. These reveal reversals, spread and possible unusual flights. Afterwards inspect a residual-versus-fitted plot, a Q-Q plot of residuals, a scale-location plot, residuals against each factor and, if recorded, flight order, and Cook's distance for influential observations. Residual patterns by angle would question its deletion, while unequal spread or departures from the normal distribution would question the error assumptions rather than merely demand another mean term.
Put and . The rank of a matrix assumption makes invertible, and is the orthogonal projection matrix onto the column space of the design matrix. The Gaussian likelihood has log-likelihood
Minimizing the squared Euclidean norm gives the ordinary least squares normal equations . Maximizing over then gives the maximum-likelihood estimators
The divisor for the maximum-likelihood estimator of the variance is , whereas the unbiased residual variance estimate is . The exceptional event has probability zero under the Gaussian linear model with ; on that event the likelihood is unbounded as .
For the joint sampling distribution, write and . Their cross-covariance matrix vanishes because . These two vectors are jointly multivariate normal, so they are independent random variables. The residual orthogonal projection has rank , hence the standard chi-squared distribution result gives
Thus these two displayed marginal laws, with their independence, specify the full joint distribution.
The quadratic form
has a chi-squared distribution with degrees of freedom and is independent of . Their ratio therefore supplies the exact F-distribution pivot
If is the quantile of that F-distribution, inversion gives the normal linear-model confidence ellipsoid
For every and every , the probability that this confidence set contains is exactly . To test the null hypothesis, reject precisely when lies outside this confidence ellipsoid, equivalently when . Under the null hypothesis the rejection probability is exactly , independent of the unknown variance.
For the numerical calculation, the second column of the design matrix sums to zero and its sum of squares is . Direct calculation from the observations gives
Consequently the ordinary least squares estimate, residual sum of squares and unbiased residual variance are
The maximum-likelihood estimator of the variance is instead . At the proposed null value the F-distribution statistic is
Therefore reject the null hypothesis at the 5% level. The relevant critical value has numerator and residual degrees of freedom.
A Poisson model assumes independent counts between rats conditional on time, a common mean at a given time, and conditional variance equal to that mean. Comparable observation units and consistent counting are needed; unexplained rat-to-rat heterogeneity is excluded by this simple specification. The quadratic Poisson regression is
The printed nested analysis of deviance tests against . Its likelihood-ratio statistic is , approximately under the null hypothesis and regular Poisson asymptotics. The reported gives borderline rejection of the log-linear time effect at 5%, conditional on the Poisson assumptions. This is curvature of the log mean, rather than an ordinary quadratic model for the count itself.
There are only three distinct time values, so the intercept, linear term, and quadratic term span every possible set of three log means. This is Poisson mean saturation at three distinct times: the quadratic fit is saturated for the time-group means, which are , , and . A grouped deviance comparison against unrestricted time-group means has zero statistical degrees of freedom: the quadratic functional form cannot be tested at these three times. The individual-observation deviance 24.515 still describes within-group departure from the Poisson distribution, but small means and zeros make the naive goodness-of-fit calibration doubtful. Poisson variation itself can be checked using the replicates, preferably by a parametric bootstrap; it is not rendered untestable by the saturated mean specification.
Overdispersion means conditional variance exceeding the variance assumed by the Poisson mean model. For example, rats may have different latent susceptibility, so if , the law of total variance gives . A quasi-Poisson model instead uses . The Pearson-residual dispersion estimate is , using .
For the conventional quasi-likelihood comparison with estimated dispersion, use
Its upper-tail probability is about 0.096, so the evidence for curvature no longer reaches 5%. The F-distribution is an approximate calibration, not an exact small-sample result for arbitrary overdispersed counts; quasi-likelihood does not supply a full Poisson likelihood. With known dispersion one would instead compare approximately with . The displayed dispersion code uses the undefined name acf.glm2; its fitted values must be those of aom.glm2 for the stated calculation.
Under the usual normal linear model for independent orchard means with common error variance, the treatment ratios have null F-distributions with denominator six statistical degrees of freedom. Their upper-tail P-values are approximately
Use the unrounded ratios when evaluating these P-values. Thus none of spray, pruning or their interaction term is significant at a 5% significance level. Spray gives modest evidence if a 10% significance level was chosen in advance, but this is not strong evidence.
Failure to reject does not establish absence of treatment effects. Only two orchards per combination and six residual statistical degrees of freedom leave considerable uncertainty and potentially low statistical power. The table alone cannot give the direction or magnitude of individual effects: that requires treatment means. These model-based F-tests also rely on appropriate orchard allocation and comparable residual variation; they should not be interpreted as unconditional conclusions from the table alone.
For an independent second sample, let
Under , independence and the two chi-squared laws give the F-distribution
For the one-sided alternative , reject for large , using the upper critical value.
No values of the unknown means enter this statistic: centering by the sample means removes them. If both means are known, one may instead use sums about the known means; the corresponding degrees of freedom are and , rather than and . Thus knowledge of the means changes the degrees of freedom and critical value, while the variance-ratio principle is unchanged.