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 haswith 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 areMuch 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.Write for the scalar intercept denoted in the question, to distinguish it from the individual means . The log-likelihood of the independent Poisson observations isDifferentiating gives the score equations for an interior maximum-likelihood estimator:In particular, when ,The left side is a weighted covariate mean whose derivative is its weighted variance, so it is strictly increasing when the covariates are not all equal. An interior solution is unique if the observed count-weighted mean is strictly between the smallest and largest covariates. At an extreme it may require a limiting slope, and if all counts are zero the maximum occurs as , rather than at finite parameters. Constant covariates make the slope and intercept unidentifiable.
Put . The negative Hessian matrix is deterministic at given parameters and is also the Fisher information matrix:Under the usual interior, increasing-information regularity for asymptotic normality of a maximum likelihood estimator, replace the unknown means by their fitted values and read the lower-right entry:Equivalently, Poisson slope information after eliminating an intercept is , with . This explains both the positive denominator for varying covariates and the loss of slope information when their spread is small.
The Poisson deviance compares the fitted Poisson regression with a saturated statistical model:using . If the usual deviance goodness-of-fit test approximation is adequate, compare with a chi-squared distribution on statistical degrees of freedom. Its upper-tail p-value is about , and . There is no detected lack of fit or evidence of substantial overdispersion from this deviance. This neither proves the Poisson regression correct nor establishes that the slope is nonzero. Small expected counts, dependence or inadequate covariate specification can undermine the reference approximation, so deviance residuals and other regression diagnostics still matter.
The Wald test of useswith an approximate standard normal distribution under the null. Its two-sided p-value is , and the approximate Wald confidence interval isThere is no convincing evidence of a covariate effect, and the slope is very imprecisely estimated. The model can fit acceptably while its slope is statistically indistinguishable from zero. In the Poisson regression, a unit covariate increase multiplies the mean by ; exponentiating the two interval limits shows how poorly this multiplier is determined on the stated scale. One might compare with an intercept-only model using a likelihood-ratio test, but its numerical deviance difference is not supplied. Failure to reject does not establish no effect.
Expanding the ordinary least squares objective givesFor a nonzero vector , , since the design matrix has matrix rank . The Hessian matrix is therefore positive-definite, and is strictly convex. Solving its normal equations gives the unique least-squares estimator:Indeed, expansion about this stationary point and give , which also proves the global minimum directly.
Define the hat matrix . It is a symmetric matrix and an idempotent linear map, since and , and its image is the column space of . Thus is the orthogonal projection onto the fitted mean space. The fitted values are and the regression residual vector is . Because is also a symmetric matrix and an idempotent linear map,These minimization and projection identities do not need errors with a normal distribution; the normal linear model becomes relevant to the distributional calculations.
Put . Since , the regression residual vector is . A linear transformation of a multivariate normal distribution is again multivariate normal, soThis is a singular multivariate normal distribution supported on , with dimension . In particular,Consequently regression residuals are neither independent nor identically distributed even under the stated model. Their linear constraints include , and, if the design matrix contains an intercept, their sum is zero.
Choose an orthonormal basis of the residual space. The coordinates of in that basis are independent variables, provingFor , is an unbiased estimator of . Orthogonality of and gives zero cross-covariance, so the Gaussian fitted and residual vectors are independent. This explains why an appropriate residual-versus-fitted diagnostic has no systematic mean relationship under the model. If , no residual information remains for these diagnostics or the variance estimate.
For , use standardized regression residuals to account for the different residual variances. The diagonal is the regression leverage; makes that residual identically zero and cannot be diagnosed by this standardization. With known , the corresponding individually standardized residual has an exact standard normal distribution. With estimated , the internally studentized residual is not exactly normal or a Student t-distribution, and the residuals remain correlated; a normal reference plot is a diagnostic approximation.
Plot the regression residuals or standardized regression residuals against fitted values and each covariate. A persistent curve suggests a misspecified mean, while a fan-shaped spread suggests heteroscedasticity; a scale-location plot helps separate these. A quantile-quantile plot against normal quantiles checks tails, skewness and possible regression outliers. Plot residuals against observation order or time to look for unexplained serial patterns, recognizing that projection already induces the displayed residual covariances. Inspect regression leverage together with Cook's distance for influential observations. Such patterns motivate revising the model; absence of a visible pattern does not prove all its assumptions.
The response errors have standard deviations proportional to . Thus, when fitted means approximate the true means, increasing absolute fitted values tends to accompany increasing residual spread. A residual-versus-fitted plot shows a fan for positive means, or spread increasing away from zero for means of either sign. Standardization by one common residual standard deviation, even with the usual regression leverage correction, does not remove this systematic heteroscedasticity.
Under independent errors the exact covariance matrix after fitting iswhere is the common proportionality constant. Hence the simple fan description is a diagnostic tendency, not an assertion that each fitted residual has exactly variance .
For positive responses, the intended variance-stabilizing transformation is the natural logarithm. The delta method givesUse for positive data with modest relative error, then refit and check the transformed mean and residual structure. In particular, if the original mean was , the transformed mean is approximately , not automatically a linear function of the original covariates.
There is a domain qualification in the literal printed model: a nondegenerate normal distribution has negative support. For positive , the probability of is , so a real is not defined throughout the stated sampling model. When is small this is a negligible-tail approximation, not an exact transformation to normal errors. If signed values must be retained and all , write with standard normal . ThenThe second term has a common distribution with finite variance, so log absolute value stabilization of a normal scale family is exact, but loses the sign of the mean and does not produce normal errors. Zeros and a zero mean are excluded from this transform. Alternatively retain the response scale and fit the stated variance model with weighted least squares weights proportional to where the means stay away from zero. No arbitrary addition of a constant before taking logarithms exactly solves the given variance relation.
read.table(...,header=T) reads four grouped rows with column names. The displayed outcome counts give the observed risks in the indicated factor order. rbind in the first test pools over predisposition: the two rows represent no cannabis use and some use, with event/non-event counts and . Thus the pooled risks are and . This test concerns the marginal statistical association between use and outcome, not an association adjusted for predisposition.Under independence, expected counts in the two-by-two contingency table are . The ordinary Pearson chi-squared statistic is . The printed is reproduced by the default two-by-two Yates continuity correction:All absolute differences here exceed one half. Comparison with a chi-squared distribution on one statistical degree of freedom gives . There is strong evidence of marginal association. The simplified output omits the usual continuity-correction wording, but its numerical value shows which statistic was used.
attach makes the data columns available by name, and tot=with+without obtains group sizes . The grouped binomial regression fits , with response and prior weights . These weights tell R the binomial denominator; treating the four proportions as four equally precise individual observations would be wrong. The default logit link isLet indicate some use and indicate predisposition. The additive logistic regression specifies . Its log-likelihood, including the binomial constants, isDifferentiation gives score equations and Fisher information matrix , where . Fisher scoring solves these equations, and the inverse fitted Fisher information matrix gives the reported approximate coefficient variances. The number of scoring iterations records numerical convergence, not degrees of freedom or statistical evidence.The intercept corresponds to no use and no predisposition and gives baseline fitted risk . The additive coefficients imply common adjusted odds ratios:They multiply the odds, not the risks. The Wald tests divide the estimates by their standard errors and use a standard normal distribution; both predictors have small two-sided p-values. Approximate confidence intervals for these odds ratios are and , obtained by exponentiating the log-scale intervals. The intercept test against zero asks whether the reference risk equals one half, and is not a test of either exposure association. The binomial dispersion is assumed to be one because ; the output does not demonstrate independence or rule out extra-binomial variation.
There are four grouped probabilities and three fitted coefficients, leaving one residual degree of freedom. The fitted risks are approximately . The binomial deviance compares this fit with the four unrestricted observed proportions:The deviance goodness-of-fit test against has p-value . The common-odds-ratio fit is not rejected at , although the doubly exposed group's observed risk exceeds its fitted risk appreciably and suggests possible interaction.
The second formula adds . Its four coefficients fit all four probabilities, making a saturated statistical model with zero grouped residual degrees of freedom. The near-zero deviance is roundoff from exact interpolation; it supplies no remaining grouped lack-of-fit test. Unlike Q1's unreplicated Gaussian fit, however, these grouped responses represent many independent Bernoulli trials, and their binomial variances are specified by their sizes and probabilities. Coefficient standard errors remain available from binomial information without estimating dispersion from the zero residual degrees of freedom.
Indeed, let be the fitted cell logit link value. The saturated coefficients areThese calculations yield the printed estimates. The delta method gives , and independent groups make the variance of the sum of all eight reciprocal counts. Its square root is , reproducing the printed standard error.
The saturated logistic regression describes the conditional odds ratios as follows:Thus the main coefficients now concern effects at the other factor's reference level. Logistic interaction as a ratio of odds ratios gives , with approximate confidence interval . The interaction Wald test has , while the nested likelihood-ratio test uses deviance difference on one statistical degree of freedom and has . The data suggest a larger odds association in predisposed subjects, but do not establish this interaction at the conventional level. This conclusion is specific to the odds scale; absolute-risk differences can vary even with no logit-scale interaction.
The Akaike information criterion is . The additive fit has and AIC ; the interaction fit has and AIC . The extra coefficient improves twice the log-likelihood by but incurs penalty , so AIC falls by only . It weakly favors the larger fit rather than decisively establishing an interaction, and AIC is not a p-value.
The marginal odds ratio and the fitted conditional odds ratios are different quantities. Predisposition is associated with both use frequency and outcome, so confounding is a substantive possibility; noncollapsibility of the odds ratio also means marginal and conditional odds ratios need not agree. This is an observational association analysis with only one adjustment factor. It does not by itself establish a causal effect, exclude other confounding, or validate the assumed independent binomial sampling.
Let and be the new-minus-standard mean cost and survival increments. The incremental cost-effectiveness ratio isUsing days per year, this is £14,600 per additional life-year. It is not cost per quality-adjusted life-year because no quality-of-life adjustment is supplied. Both point-estimated increments are positive, so the new intervention exchanges higher cost for longer survival; this is not dominance.
Assume the two trial arms are independent samples, their cost and survival means have a valid joint normal approximation, and the supplied standard errors and correlation coefficient estimate the joint uncertainty in their mean differences. This could follow from a central limit theorem for patient-level cost/survival pairs, with finite second moments and suitably handled survival follow-up. The supplied covariance matrix for isThe off-diagonal entry has units pounds times days, and must not be discarded. Independence of trial arms does not mean cost and survival increments are independent: patient-level cost and survival are paired within each arm.
For a proposed ratio , the null assertion is . Its estimated variance is . Fieller's theorem inverts the associated two-sided normal tests. With , retain whenExpanding givesThe leading coefficient is positive, since ; the effect increment is separated from zero at this level. With , the polynomial is approximatelyIt is nonpositive between its two real roots. The resulting approximate Fieller confidence set is therefore a bounded confidence interval:On the -day life-year scale the endpoints are approximately £9,133 and £36,376. Exact coverage would need an exact pivot with its corresponding critical value; using estimated covariance and a central limit theorem makes this an asymptotic interval. In other data, a poorly determined denominator can give unbounded or disconnected Fieller confidence sets, which should not be replaced by an artificially bounded interval.
An alternative is a paired bootstrap: independently resample patients within each randomized arm, keeping each patient's cost and survival together; recompute both mean differences and their ratio in each replicate. The and empirical ratio quantiles give a percentile bootstrap confidence interval. The raw paired data are needed to calculate it, so the numerical endpoints cannot be obtained from this summary table alone. Near-zero bootstrap effect increments or sign changes warn that ordinary ratio-percentile intervals may be unreliable; one should retain the joint cost/effect uncertainty or invert a suitable bootstrap test instead.
A simpler first-order alternative is the delta method. For , the gradient is , givingThe resulting approximate Wald confidence interval is pounds per day. Its symmetric first-order form misses the denominator's nonlinear effect, explaining its marked difference from the Fieller confidence set; it is not the preferred ratio interval here.
The incremental cost-effectiveness ratio must be read with the signs of both increments. A negative ratio can mean either greater effectiveness at lower cost, which is favorable, or lower effectiveness at greater cost, which is unfavorable. A positive ratio can likewise lie in either the more-costly/more-effective or cheaper/less-effective quadrant. Thus ordering ratio values without locating the cost-effectiveness plane quadrant can reverse a decision.
The incremental cost-effectiveness ratio is undefined at a zero effect increment and extremely unstable near it. Its sampling distribution can be highly skewed and its mean may fail to exist; a usual symmetric confidence interval or an interval spanning positive and negative ratios can conceal that instability. Cost-effect correlation must be retained, as the Fieller confidence set calculation illustrates.
Interpretation also requires a specified comparator, effect unit, costing perspective, follow-up horizon and willingness-to-pay threshold. Different comparator choices give different incremental ratios, and lower ratios alone do not settle decisions across differently scaled outcomes. Longer survival need not mean a proportional quality-of-life gain; extrapolation, censored outcomes and omitted costs can affect the increments. Point estimates conceal both sampling uncertainty and uncertainty in these assumptions.
For a positive effect increment, comparison with a threshold is equivalent to . For negative effect increments that inequality reverses when multiplied by , so a rule that blindly compares all ratios with is wrong. Use the signs and joint cost/effect uncertainty, or the incremental net monetary benefit , rather than the ratio alone. No particular threshold is given in the paper, so the point estimate does not establish whether reimbursement should occur.
One presentation is the cost-effectiveness plane, with horizontally and vertically. Plot the point estimate with a joint confidence region or paired bootstrap cloud. Its position shows the tradeoff quadrant, while the cloud shows uncertainty, dependence and possible dominance. A willingness-to-pay threshold is the line through the origin. Points below that line have positive incremental net monetary benefit, including points in quadrants where a ratio rule would fail. The point-estimated switch occurs at pounds per day.
A second presentation is a cost-effectiveness acceptability curve, giving an uncertainty-based measure of cost-effectiveness for a range of thresholds. For paired bootstrap increments , plotThis counts positive net benefits, not merely ratios below the threshold, so it handles all quadrants. Using Bayesian inference the curve is the posterior probability that incremental net monetary benefit is positive; a frequentist bootstrap curve is a resampling summary, not literally a probability that a fixed parameter is positive.
Here the estimated incremental net monetary benefit and its standard error areThus a normal approximation uncertainty curve isIt passes through one half at £40 per day. Alternatively display the incremental net monetary benefit curve itself with approximate pointwise bands . The plane preserves the joint uncertainty; the acceptability curve shows how the threshold changes the cost-effectiveness assessment. Neither presentation chooses society's willingness-to-pay threshold.
Articles by others on the same topic
There are currently no matching articles.