There are observations, since the intercept-only model has residual degrees of freedom. Adding price introduces one coefficient and decreases the binomial deviance by . Adding a three-level factor introduces two coefficients and decreases it by . Thus the missing entries are
The likelihood-ratio test comparing the smaller and full logistic regression tests against at least one nonzero layout contrast. Its statistic is . Under ordinary interior-parameter, full-rank and finite-estimate regularity conditions, Wilks theorem gives an asymptotic chi-squared distribution with two degrees of freedom. The reported p-value exceeds , so at that level retain the simpler price-only model.
The table is an analysis of deviance for nested generalized linear models: price is entered before layout. Thus its price row tests the price-only model against an intercept, whereas the layout row tests layout after allowing for price. The latter is the relevant comparison of model1 and model2. Failing to reject a layout effect is not proof that layouts have identical effects; it means these data do not justify the extra two parameters under this test.
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.
The pivot has independent standard normal coordinates, so has the chi-squared distribution with degrees of freedom. Let be its quantile. The confidence ellipsoid
therefore has exactly coverage for every . No large-sample approximation is required when the covariance is known.
Use the convention that the likelihood ratio is maximized alternative likelihood divided by null likelihood. The alternative excludes zero, but its supremum agrees with the unrestricted maximum, even on the exceptional sample . Completing the square gives
Under the null, , so exactly for every . Equivalently is distributed as for . With the reciprocal likelihood-ratio convention the statistic is instead.
Wilks theorem predicts a limiting chi-squared distribution with degrees of freedom equal to the difference of parameter dimensions, here , under regularity and an interior null point of the unrestricted model. This example strengthens the asymptotic conclusion to an exact finite-sample identity.
Under the null hypothesis that treatment and recovery are independent, estimate each expected cell count by
and form the Pearson chi-squared test of independence statistic . For a table its asymptotic null law is a chi-squared distribution with one degree of freedom. A second-order Taylor expansion of the generalized likelihood-ratio test statistic around the fitted counts gives this Pearson statistic, which explains its asymptotic null distribution.
Writing the four residuals over their fitted counts and simplifying gives
For ,
whose one-degree-of-freedom p-value is about . There is no evidence of an effect. One fitted count is only , however, so the chi-squared approximation is questionable; Fisher's exact test would be preferable.
For a diagonal entry, put . Independence and the given moment-generating function inequality for the chi-squared distribution give
The Chernoff bound with yields
Apply the same argument to and sum the two tails:
To obtain the off-diagonal bound, set and . They are jointly normal with unit variances and covariance zero, so independence of uncorrelated jointly normal variables makes them independent standard normals. Since , the moment-generating function of the product of two independent standard normal random variables is
For , is a sum of independent such products. The given inequality implies for . Taking , and repeating for the negative tail, gives
Now take and . There are diagonal entries but only distinct off-diagonal entries, since is symmetric. By the union bound, the event has probability at least
This is the required entrywise concentration of a Gaussian Gram matrix.
On that single event, any vector supported on at most coordinates satisfies
where the last step is the Cauchy-Schwarz inequality on the support. If each have at most nonzero coordinates, has at most . The same entrywise event applies simultaneously to all of them, so no union over vectors is needed. The sparse norm preservation from entrywise Gram control gives
The printed ratio is undefined at . Its equivalent quadratic statement, , includes that case trivially. The nontrivial concentration argument assumes ; at the stated probability lower bound is nonpositive and hence vacuous.
Under a correctly specified Poisson regression with adequate expected counts, the residual Poisson deviance is approximately chi-squared distribution with residual degrees of freedom. The observed gives
Thus the ordinary Poisson model gives a very poor fit under this goodness-of-fit approximation. This is consistent with overdispersion, although a wrong mean model or dependence can also cause lack of fit; quasi-Poisson variance inflation alone does not establish that the mean model is adequate.
For Quasi-Poisson regression, . The Pearson dispersion estimator is
It uses squared Pearson residuals, not the residual deviance divided by 102. The fitted coefficients are unchanged, and their estimated covariance matrix is multiplied by . With , standard errors increase by , so the main treatment coefficient has
The main Progabide coefficient is not significant at 5% after this dispersion adjustment. R uses a Student's t-distribution when dispersion is estimated, as described in its GLM summary documentation; the large-sample normal approximation also gives the same decision.
Because an interaction term is present, this tests the treatment contrast at baseline zero. An overall absence of treatment influence requires the joint null . The printed marginal standard errors do not give their covariance, so they are insufficient to calculate that joint Wald test, or the treatment contrast test at an arbitrary nonzero baseline.
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.
The multivariate Wald statistic for a proposed value is
Because and
Slutsky theorem gives
If is the -quantile of the chi-squared distribution with degrees of freedom, an asymptotic confidence region is
In this known-identity-covariance model one may replace by ; then the confidence ball is exact. For an individual coordinate, the corresponding exact confidence interval is
Treat the cell counts as independent Poisson random variables. Under independence of Month and Hospital, the independence log-linear model for a two-way contingency table is
with no Month–Hospital interaction. Compare its Poisson deviance with the appropriate upper quantile of a chi-squared distribution. This is the likelihood-ratio test of independence in a contingency table.
The approximation assumes independent counts with correctly specified Poisson means, identifiable parameters, and sufficiently large fitted cell means for the asymptotic chi-squared law to be accurate. Equivalently, one may condition on the margins and use the corresponding multinomial sampling formulation.
For the month table there are cells and independent model parameters, so the residual degrees of freedom are
Since
model 1 does not reject Month–Hospital independence at the level.
After combining months into four quarters, the table is , giving
degrees of freedom. Now
so model 2 rejects Quarter–Hospital independence at the level.
There is no contradiction. Relabelling twelve months as four quarters aggregates the contingency table, changes the null hypothesis, and reduces the degrees of freedom. The quarter-level hospital pattern is coherent enough to cross the much lower six-degree-of-freedom threshold even though the more detailed month-level omnibus test does not. This is an instance of how aggregation can change a contingency-table independence test.
Let denote the -quantile of the chi-squared distribution. Since , inversion of the central probability event gives
as a confidence interval for .
Since and a standard normal variable has second and fourth moments and ,
Thus has the chi-squared distribution with degrees of freedom and
Convergence in distribution means that the cumulative distribution functions satisfy at every continuity point of . The Lévy continuity theorem states that this is equivalent to pointwise convergence of characteristic functions to the characteristic function of , provided the limiting function is continuous at zero.
For fixed , independence and a Gaussian integral give
Using ,
Therefore , the characteristic function of the standard normal distribution. Lévy's theorem now gives
This derives the limit directly, without assuming the central limit theorem.
Put
The log-likelihood, apart from an additive constant, is
Over the full parameter space its maximum-likelihood estimates are . Under , maximizing over the nuisance parameter gives . Thus the generalized likelihood-ratio test statistic, in the convention , is
Under , the normal-sample decomposition gives
Writing , the central limit theorem for a sum of squared independent standard normal variables yields . Hence Slutsky theorem gives
and in particular .
For , Taylor theorem at gives
Consequently
by the continuous mapping theorem and Slutsky's theorem. Since the square of a standard normal variable has the chi-squared distribution with one degree of freedom,
Under , the Hilbert-space central limit theorem gives
where is a centered Gaussian random element with covariance . Distinct leading eigenvalues imply consistency of the empirical eigenvalues and eigenfunctions, up to irrelevant signs. The first standardized functional principal component scores of are independent variables, so Slutsky theorem yields
An asymptotic level- test rejects above the quantile of the chi-squared distribution.
Under a fixed alternative, put . The weak law of large numbers and eigenpair consistency give
Thus the statistic diverges and the test is consistent whenever at least one retained projection is nonzero. A fixed alternative orthogonal to the first eigenfunctions is invisible to this fixed- statistic.
Let be the ordered eigenpairs of the common covariance operator , and write . Estimate by the pooled covariance operator
and denote its first eigenpairs by . The sign ambiguity of each eigenfunction disappears after squaring. Consider the Two-sample FPCA mean statistic
Under , the Hilbert-space central limit theorem gives
where is a centered Gaussian random element with covariance . The assumed eigenvalue gaps give consistency of the estimated eigenvalues and eigenfunctions, so Slutsky's theorem yields
An asymptotic level- test therefore rejects when exceeds the -quantile of the chi-squared distribution with degrees of freedom.
Under a fixed alternative,
The test is consequently consistent whenever the mean difference has a nonzero projection onto one of the retained principal components. A difference orthogonal to their span is invisible to this fixed- test, so alone does not guarantee consistency. Increasing with can recover such alternatives, but requires additional eigenvalue and approximation control.
The multivariate Wald statistic for a candidate parameter is
Replacing by any consistent estimator of gives the same limit.
Under , part (a) and consistency of the information matrix imply, by Slutsky theorem, that
Consequently
using the characterization of the chi-squared distribution as the squared norm of a standard normal vector.
If is the quantile of , an asymptotic confidence region is
The Pearson goodness-of-fit test has null hypothesis that the independent counts follow the fitted Poisson regression, in particular , against the alternative that the model does not fit; in this setting the scientifically relevant direction is overdispersion, . Under the null, is approximately chi-squared distribution with degrees of freedom. Its tiny -value decisively rejects the Poisson variance assumption.
The negative binomial regression keeps the logarithmic mean model but allows . It improves the residual deviance from to , close to its residual degrees of freedom, and lowers the Akaike information criterion from to . Both comparisons strongly favour the negative-binomial fit, although its dose coefficient remains statistically insignificant.
Let be the leading eigenpairs of the sample covariance operator. For fixed with and , the FPCA mean test uses
Under the null, consistency of the empirical eigenpairs and the multivariate central limit theorem imply
The level- test therefore rejects above the quantile of the chi-squared distribution with degrees of freedom.
For a fixed mean , if at least one leading coordinate , , is nonzero, then in probability and the test is consistent. It has only null-level asymptotic power against means orthogonal to the first principal component functions. Under , the limit is noncentral chi-squared with noncentrality
For observed counts and positive expected counts in a contingency table, the statistic is . Under common category probabilities or statistical independence, estimate by the product of the row and column totals divided by the grand total. With large expected counts, this gives the test statistic for the Pearson chi-squared test of homogeneity or the Pearson chi-squared test of independence, with asymptotic chi-squared distribution on degrees of freedom.
The Pearson chi-squared test of homogeneity tests whether several independent categorical samples have the same category probabilities. Under the null, expected cell counts equal the product of the corresponding row and column totals divided by the total sample size. The Pearson chi-squared statistic for contingency tables has an asymptotic chi-squared distribution with degrees of freedom, when expected counts are sufficiently large. The sampling design differs from a Pearson chi-squared test of independence, though the statistic has the same form.