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.
Both fits are the same additive two-way analysis of variance model: a common intercept, five country effects represented by four contrasts, and eight item effects represented by seven contrasts. The three missing cells are omitted, leaving observations and model rank , hence residual degrees of freedom. The residual sum of squares is in either ordering, giving
These are sequential sums of squares, so each row measures the improvement when that factor is added after the preceding factors. The country-first sum describes its unadjusted contribution before accounting for item; its displayed and are not the country-adjusted-for-item test. When country is added after item, its extra sum is , giving
Thus the additive normal linear model gives strong evidence of country differences after accounting for the different products. Conversely, item added after country has extra sum , so
The printed zero for this probability is numerical formatting, not a probability literally equal to zero. Product differences are much larger than residual variation, as expected from their different scales.
The explanation for the order dependence is that missing cells can destroy factor orthogonality in two-way ANOVA. A complete equally replicated crossed design would make centered country and item indicator columns orthogonal. Here the missing observations change the item mix across countries and the country mix across items, so the two factor subspaces are not orthogonal. The two sequential partitions still have the same total explained sum: to the displayed precision. For inference about either factor conditional on the other, compare the full model with the reduced model that omits that factor, rather than interpreting its first-entry sum as adjusted evidence.
The omnibus country test does not identify the particular country contrasts. As an extension, fitting the supplied price table gives the item-adjusted UK-minus-US contrast about pounds, with standard error and an ordinary Gaussian-model confidence interval approximately pounds. This is a derived model contrast, with Student t-distribution reference on degrees of freedom; simultaneous exploration of many country pairs requires control for multiple hypothesis testing.
Check residuals against fitted values, product and country, together with a normal Q-Q plot and influential observations. The homoscedasticity assumption on absolute prices may be doubtful because expensive products can have larger absolute variation. A model for logarithmic prices gives multiplicative country effects and can make the scale assumption more plausible. Country-by-item interaction terms would allow discounts to differ by product, but there is at most one observed value per cell: an unrestricted interaction saturates the observed means and leaves no pure-error degrees of freedom, so it cannot be tested against independent measurement noise from these data alone. Additional products or genuine cell replication would support that extension. The selected products and non-random missing entries also limit claims about a whole country's consumer prices; the conditional inference is for the stated additive model and observed price collection.
For logistic regression, set and . Its Bernoulli log-likelihood, score function and Fisher information are
where . Solve by Fisher scoring or iteratively reweighted least squares. One scoring step is
Equivalently regress the working response on using weights . Iterate until the likelihood and coefficients stabilize, with rank and convergence checks. Separation in logistic regression can prevent a finite maximum: if a predictor direction strictly separates the zeros and ones, moving indefinitely along it improves the likelihood rather than producing a finite root.
Under the unrestricted model, each individual probability is estimated independently as . Every observed binary outcome then has probability one, so, using boundary limits,
The resulting residual deviance is . It is a legitimate likelihood contrast and can be used to compare fitted models. However, individual Bernoulli deviance need not have a chi-squared calibration: the saturated model has one boundary-valued parameter for each single observation, and its dimension grows with . The fixed-dimensional regularity behind Wilks theorem does not justify a reference here.
For a concrete demonstration, let the true model contain only an intercept and have success probability . Its fitted probability is , and
whereas a variable divided by converges to one. Thus treating the raw Bernoulli residual deviance as an ordinary absolute goodness-of-fit statistic can reject a correct model systematically. In contrast, deviance differences between fixed-dimensional nested logistic models have their usual asymptotic chi-squared reference under the relevant regularity assumptions. For absolute fit use meaningful replicated covariate groups and grouped-binomial logistic regression, or assess residual patterns and prediction on held-out data; a model-specific parametric bootstrap can calibrate a chosen statistic.
The family-history table contains men, of whom have the response present, giving an overall observed fraction . The unadjusted fractions are with a positive family history and without one. Their crude odds ratio is ; this is not the covariate-adjusted effect from the fitted logistic regression.
The full model has an intercept and nine slopes, hence residual degrees of freedom. The binomial distribution dispersion is fixed at one. Although the software labels coefficient-to-standard-error ratios as t values, here they are asymptotic normal Wald statistics, not statistics with an estimated Gaussian residual variance and an exact Student reference. The full conditional coefficients provide evidence for tobacco, cholesterol, family history, behaviour score and age: their absolute Wald ratios are approximately . The other four ratios are smaller in magnitude, especially alcohol at about . These are conditional associations; a weak adjusted coefficient does not by itself establish absence of an underlying association, and multicollinearity can affect the estimates.
The null deviance is on degrees of freedom and the full residual deviance is on . Their difference has a nominal nine-degree-of-freedom likelihood-ratio test reference for the nine slopes jointly. The absolute residual deviance should not automatically be compared with for the reasons in part (i).
The shown stepwise selection by the Akaike information criterion follows a backward path. For individual binary observations the saturated log-likelihood is zero, so
where includes the intercept. Removing a one-parameter term improves AIC exactly when the increased deviance is less than two. The successive deletions are alcohol, adiposity, blood pressure and obesity. The corresponding values are
At the final step, every remaining single-term deletion increases AIC. This is a local stopping condition of the search, not a proof that it found the best subset among all possible models. Obesity is retained for several steps because its successive deletion costs differ after the other terms are removed; the procedure does not simply sort the initial Wald ratios.
For the selected fit, write for positive family history and otherwise. The fitted linear predictor is
Holding the other predictors fixed, a unit increase multiplies the odds by . In the same variable order, the unit odds ratios are
A ten-year age difference multiplies the fitted odds by , and ten behaviour-score points by . Family history has adjusted odds ratio about , with ordinary fitted-model confidence interval . The intercept is the log odds at zero numerical covariates and absent family history; that extrapolated baseline is not a typical man's risk. Odds ratios are not risk ratios.
The selected model's residual degrees of freedom are , consistent with its six coefficients. All five retained slopes have nominal normal-Wald values below in that model, but these tests and confidence intervals do not incorporate the prior model selection. Its improvement over the intercept-only fit is on five nominal degrees of freedom; it loses only deviance units relative to the nine-slope fit while using four fewer parameters. Selection optimism remains relevant to predictive performance. Check possible nonlinear continuous-predictor effects, influential observations and clinically motivated interactions; assess out-of-sample discrimination and agreement of predicted probabilities with observed frequencies by cross-validation or external data. The printed output alone does not supply those diagnostics, and the selected high-risk male population limits extrapolation to other populations. Nothing here establishes causal effects of these observational predictors.
Use for the expected accident count, not for the accident rate. With a design row consisting of an intercept, seven non-reference site indicators and the after-treatment indicator,
Here is a known generalized linear model offset, with coefficient fixed at one. Differentiating the Poisson regression log-likelihood gives the score function equations
These nine equations estimate the intercept, seven site contrasts and one treatment contrast, with the stated reference-level constraints.
The Fisher information is , where . A Fisher scoring update adds to the current coefficient vector. In iteratively reweighted least squares, the working response is ; regress on the design with weights . Thus the reported four iterations solve the likelihood equations while accounting for unequal exposure periods.
The common adjusted rate ratio is obtained by exponentiating the after coefficient:
This estimates a lower accident rate after the intervention, conditional on the additive site model. The standard error gives normal Wald statistic , two-sided , and an approximate confidence interval for the rate ratio
The label t value is again a normal-reference Wald ratio under fixed Poisson dispersion, rather than an exact Student statistic.
The intercept gives the before rate at reference site one: accidents per year. The seven site coefficients are log baseline-rate ratios relative to that site. In site order two through eight, their exponentials are about . The third site has the largest estimated rate and a nominal Wald ratio about against the reference. These are adjusted baseline comparisons, not differences in absolute accident counts. The overall unadjusted before/after rate ratio is , and it differs from because site risks and their relative exposure weights differ.
An independent way to solve the fit is the profile likelihood for a common Poisson rate ratio with unequal exposures. Put and . For fixed , the site score gives . The remaining equation is
Its positive root reproduces the reported treatment estimate. Comparing the same site model with to the fitted model gives a deviance improvement about on one degree of freedom, with nominal likelihood-ratio .
There are count observations and fitted mean parameters, leaving residual degrees of freedom. The null deviance on degrees of freedom is for the intercept-only rate model, still including the exposure offset. The residual Poisson deviance is on degrees of freedom. A chi-squared comparison gives approximately , suggesting potential lack of fit of a single common treatment ratio; the extreme deviance residuals near and also deserve inspection. Several after-cell expected counts are below one or near two, so this absolute-fit calibration is only approximate. Site-specific treatment effects, overdispersion or temporal dependence are possible explanations to investigate, with a parametric bootstrap available to calibrate the sparse-count fit statistic. A before/after association alone does not isolate a causal effect from secular changes or regression to the mean at selected sites.
The Poisson regression margin-matching score equations from the site indicator for each directly give
Subtracting these seven row balances from the intercept equation gives the missing reference row balance. Therefore
The after-indicator score similarly gives . Subtracting it from the intercept balance yields the before-column balance, so
Thus the fitted before and after count totals are and , and each fitted site total equals its observed total. These identities concern expected counts ; unequal exposures do not imply corresponding unweighted sums of fitted rates equal sums of observed rates. They follow from the unpenalized canonical Poisson likelihood and the available intercept/factor columns, not from balanced exposure periods.
The first approach specifies marginal means, variances and an exchangeable correlation for each student's repeated counts. It is a moment model suitable for a generalized estimating equation; equality of the mean and variance alone does not specify a full Poisson joint distribution. Different students supply independent sampling clusters, while the three counts within a student are dependent.
The second approach is a Poisson generalized linear mixed model with a positive shared random multiplier . Conditional on it, the three counts are independent Poisson variables; integrating over it gives a fully specified dependent joint law. The gamma random-intercept Poisson model uses Gamma shape and rate , so and . Treat the covariates as fixed, with the same multiplier distribution across covariate/treatment groups, as required by this model.
Let and . The law of total expectation, law of total variance and law of total covariance give
Thus each marginal is a negative binomial distribution by the Poisson-gamma mixture, rather than generally a Poisson variable. Put . Its variance is , and the marginal correlation is
It is positive but usually depends on the two marginal means, so it need not be the common exchangeable correlation proposed in the first approach. The first method focuses on population mean effects with a chosen working correlation matrix; the second models latent student heterogeneity and separates conditional Poisson variation from additional marginal variation. Correctly specified likelihood inference for the second uses more distributional assumptions, while the first can retain valid mean inference despite a wrong working covariance by using a cluster-level sandwich variance.
For the marginal mean model, is the expected term count for a student with all recorded covariates at their reference or zero values. If the treatment indicator is one for the new therapy and zero for the reference treatment, then is the ratio of population mean counts under the two treatments, holding the remaining covariates fixed. Values below one mean a reduced expected count; is the corresponding percentage reduction.
For the random-intercept model, is the conditional reference count at , or multiplier ; the conditional baseline for student is . It is not automatically the mean-population baseline, which is . The conditional treatment rate ratio for students with the same multiplier is . Because the multiplier has the same distribution in the treatment groups and the mean uses a logarithmic link function, that is also the marginal treatment rate ratio. This is the property that marginal and conditional slopes agree for an independent log-link random intercept.
The parameter is the variance of the positive student multiplier, not a Poisson sampling variance or a treatment coefficient. Greater at fixed means greater heterogeneity in underlying propensity and larger between-term covariance. Its extra contribution to the count variance is . If is imposed, is also the relative multiplier variance; otherwise the relative heterogeneity is .
There is a necessary identifiability qualification: if the multiplier mean is also unrestricted, scale identifiability in a gamma random-intercept Poisson model shows that replacing
leaves the response law unchanged. Consequently only and , together with the slopes, are identified from these counts without a scale convention. Fixing the multiplier mean, usually to one, is needed to interpret the conditional intercept and heterogeneity scale separately.
Integrating the conditional mean in the gamma random-intercept Poisson model gives
and hence
The marginal model's logarithmic mean family is therefore correctly specified, with a shifted intercept and identical slopes. Under the usual independent-cluster and estimating-equation regularity conditions, fitting that marginal mean consistently estimates
Thus the treatment and other slopes estimate the intended marginal log rate ratios; indeed they also coincide with the conditional slopes under the stated common random-effect distribution. The intercept consistently estimates the marginal baseline, but not the conditional intercept unless . If the first investigator interprets the intercept as a conditional latent-student baseline without recognizing this shift, that interpretation is incorrect.
The assumed Poisson marginal variance and constant correlation generally fail under this random-effect law. They need not invalidate mean-coefficient consistency for a suitable generalized estimating equation, because the expected residual vector is still zero at the true marginal mean. They do invalidate naive standard errors based only on that assumed covariance; robust inference requires the correction in part (iv). The simple unchanged-slope result relies on the random multiplier distribution not changing with covariates, rather than on a universal equivalence of marginal and conditional regression models.
Use a generalized estimating equation with any well-behaved positive-definite working correlation matrix. Let collect the marginal intercept and slopes, let be the vector of three correct marginal means, and put . Write the working covariance as , where the proposed Poisson variance gives ; working independence is also allowed. Solve
At the true mean, each cluster residual has expectation zero, so the estimating equation is unbiased regardless of whether equals the actual covariance. With independent students, sufficient covariate variation and regularity as , this gives consistent mean coefficients.
Replace the model-based covariance by the cluster-level sandwich covariance matrix. Evaluated at the fitted values, define
Then
The residual outer products estimate the actual within-student variability, including correlations and extra-Poisson variance absent from the working model. Use these standard errors for asymptotic Wald tests and confidence intervals; exponentiating the treatment coefficient and its interval gives the mean-count rate ratio and interval. Treating the observations as independent when forming the sandwich meat would miss the within-student dependence. The effective asymptotic replication is the number of students, so a small number of clusters requires further finite-sample care rather than assuming that three measurements per student repair the large-sample approximation.
For independent Poisson counts, the log-likelihood at mean vector is
The saturated model maximizes each cell separately at , including the boundary value zero. If is the fitted mean under the log-linear regression, twice the saturated-minus-fitted log-likelihood is the full Poisson deviance
with understood by continuity. The fitted intercept has score function , since differentiating the logarithmic mean with respect to that intercept gives one. Its maximum-likelihood equation therefore gives . This is why Poisson deviance simplifies when an intercept is fitted:
Without the fitted unpenalized intercept, one cannot generally discard the two linear terms. The individual logarithmic terms in the simplified sum need not each be positive; nonnegativity belongs to the full deviance, or to the full cell contributions before cancellation.
For the approximation, write and expand . When relative residuals are small,
Consequently the quadratic Pearson approximation to the Poisson deviance is
the Pearson chi-squared statistic for unit Poisson dispersion. Adequate expected counts and small relative residuals are what make the quadratic approximation useful; it is not an exact identity and can be poor for sparse cells, especially a zero count with positive fitted mean. Any further chi-squared goodness-of-fit reference needs its own large-count regularity assumptions.
With the negative-binomial size held fixed, collect all mean-independent terms into . The cell log-likelihood is
Its derivative is
For it is positive below and negative above , so the saturated maximum is at . For , the maximum is the boundary limit . Evaluating the saturated-minus-fitted log-likelihood gives the negative binomial deviance
All gamma-function and factorial terms cancel because the same known is used in both models. The zero-count logarithmic term is interpreted as zero; its remaining cell contribution is . No intercept score cancellation is required for this formula, so it applies to the specified design whether or not its covariates include an intercept.
For completeness, the fitted coefficients obey the score equations of the fixed-size negative binomial generalized linear model,
The logarithmic link is not the canonical link for this family, but it produces the requested positive means. As a check, when ,
so the formula tends to the full Poisson deviance, including the linear terms when an intercept-balance equation is unavailable. The size used here is the negative-binomial size parameter; it is distinct from the random-multiplier variance denoted by the same letter in Question 4.

Articles by others on the same topic (0)

There are currently no matching articles.