For two independent samples of Bernoulli random variables, the difference of their sample proportions estimates the difference of population probabilities. Since the samples are independent,
Substitution of the sample proportions gives a standard error for a large-sample Wald confidence interval. This interval is a descriptive comparison of the specified groups; a causal effect needs further assumptions. Sparse counts and probabilities near zero or one can make the normal approximation poor. Testing equality can instead use a null-pooled estimate of the common probability for the test's standard error.
Estimation error 2026-10-31
An estimation error is the difference between an estimator and the statistical parameter it estimates. It is a random variable before observing the sample. Its mean is the bias of the estimator, and its mean square is the sum of the variance and squared bias. Standardizing an estimation error by its standard error often yields an approximate standard normal distribution, allowing construction of a Wald confidence interval.
Conditioning on marital status produces five contingency tables. In each, compare the conditional row percentages. The following differences are the sample proportion with some bad experiences minus the sample proportion without them, in percentage points; negative very-safe differences mean fewer respondents feeling very safe in the former group.
Marital-status stratumDifference: very safeDifference: unsafeReported Pearson's chi-squared test p-valueCramér's VGoodman and Kruskal's gamma
Single
Married
Living with a partner (inconsistent; see below)
Divorced
Widowed
The p-values test independence within the respective strata; the magnitudes and directions come from the conditional percentages and association measures. Differences in the table are calculated from the counts before rounding.
Among single respondents, the very-safe sample proportion changes from to , while the unsafe sample proportion changes from to . The direction resembles the weak pooled pattern, but supplies little evidence against independence in this stratum. This is not evidence that the population association is exactly zero.
Among married respondents, the very-safe sample proportion changes from to and the fairly-safe sample proportion rises from to . Unsafe remains almost unchanged, versus . Thus the within-stratum association again chiefly shifts very safe toward fairly safe. Its is below the significance level, while still indicates a small association.
For respondents living with a partner, very safe changes from to , fairly safe from to , and unsafe from to . The very-safe difference is larger than in the married stratum. The printed p-value would be just below the conventional significance level. However, this particular output is internally inconsistent: recalculating Pearson's chi-squared test from its six displayed counts gives , , and . The reported agrees with the counts, whereas the printed would itself imply for two statistical degrees of freedom, rather than the printed . Using the displayed counts, this stratum does not reject independence at . The source PDF itself contains these incompatible figures; this is not resolved by rounding.
Among divorced respondents, very safe changes from to , but unsafe also decreases, from to , as fairly safe increases from to . This is a redistribution toward the middle category, not a simple shift toward greater unsafety. The near-zero gamma, , reflects the lack of a consistent ordinal direction, while can still register distributional differences without a direction. The p-value does not reject independence.
Among widowed respondents, very safe changes from to , and unsafe from to . The ordinal association is positive on the chosen ordering, with gamma . Its lack of conventional statistical significance, , does not imply a smaller estimated association than in the married group: the widowed stratum has only complete observations, versus in the married stratum, and therefore less precision. All five tables have sufficiently large expected counts for the reported approximations; even the smallest expected count is about .
Figure 1.
Derived safety-category differences and unadjusted uncertainty by marital-status stratum
. Details.
The plot uses large-sample Wald confidence intervals for the difference of independent sample proportions within each stratum. They concern the individual category contrasts, whereas the tabulated Pearson's chi-squared tests compare the full three-category distributions. The intervals are unadjusted for multiple hypothesis testing; the pooled row reuses the stratum observations, so it is not a sixth independent sample.
In the elaboration model, the persistence of a generally weak positive ordinal pattern within four strata is closer to partial replication than to a complete explanation of the pooled association by marital status. The differences in estimated patterns suggest possible specification: the divorced group's shift toward the middle category differs from the widowed group's shift toward unsafe. They do not by themselves establish population effect modification. In particular, significant and nonsignificant results need not differ significantly; compare the effects using an interaction contrast or a fitted model with the appropriate interaction terms, rather than comparing their separate p-values.[ref]
One additional omnibus check can be derived from the supplied tables without assuming a common effect. Recalculating the five statistics from the counts, including the corrected living-with-partner statistic, the joint conditional independence test for stratified contingency tables gives
Under independent-stratum sampling this tests independence within every stratum jointly; it does not test whether the association is homogeneous across strata. It does not reject at , but this alone does not establish that stratification removed the population association: its ten-degree-of-freedom alternative is less focused than the pooled two-degree-of-freedom test, and nonrejection is not proof of equality.
The elaboration model also distinguishes an antecedent confounder from an intervening causal mediator. These cross-sectional tables do not establish the relevant time ordering or identify either role for marital status. Five separate stratum tests further require caution about multiple hypothesis testing: for example a Bonferroni correction at familywise would use per test, below all five individual p-values. That caution changes the interpretation of selected significance labels, not the observed conditional percentages.
The estimated patterns vary across strata, but the tables neither establish a population interaction nor prove that marital status explains away the association.
Here . The maximum-likelihood estimate and estimated standard error from the observed Fisher information are
The 95% Wald confidence interval is therefore
The whole reported confidence interval lies in , though its lower endpoint is close to the boundary. With only four observations, the normal approximation underlying this Wald confidence interval need not provide accurate 95% coverage.
Keep the true parameter fixed and imagine repeatedly collecting four independent and identically distributed observations under the same model. Compute the maximum-likelihood estimate, its estimated standard error, and the Wald confidence interval afresh each time. The intended coverage statement is that approximately 95% of those random confidence intervals contain the fixed true parameter, provided the normal approximation is adequate.
After these particular observations have been collected, both endpoints are fixed. The frequentist statement does not assign 95% probability to the fixed parameter lying between these particular endpoints. Nor does the confidence interval describe the range containing 95% of future observations. The small sample makes the nominal 95% coverage an approximation whose accuracy is not guaranteed.
Let be the design matrix with row , let , and write . Independence gives the Poisson regression likelihood function
The score function and negative Hessian matrix are
Because , the score has mean zero; independence and the Poisson distribution variance give . Thus the observed and expected Fisher information matrices are the same here.
Assume has full column matrix rank . For a nonzero vector , . The concavity of the Poisson regression likelihood therefore makes any finite solution of the unique maximum-likelihood estimator. If the design is rank deficient, parameters differing by a vector in give the same distribution, so only identifiable combinations can be estimated. Full rank alone does not ensure a finite maximizer: for an intercept-only model with all observations zero, approaches its supremum as . More generally, directions that decrease only fitted means attached to zero counts can produce boundary fits. A useful sufficient case for a finite fit is full rank with every count positive: each summand tends to in either tail, and some diverges whenever diverges.
For an interior fit, Newton's method and Fisher scoring give the same update:
This is also iteratively reweighted least squares. Define the working response , with , and regress on using weights :
A numerical implementation solves these linear equations rather than explicitly forming the inverse, checks convergence of the score and likelihood, and can shorten a step when necessary.
Under the usual fixed-design regularity conditions, with growing information and no single observation dominating it, a score Taylor expansion about the true parameter gives
Estimate the covariance matrix by ; its diagonal square roots are the coefficient standard errors. This justifies large-sample Wald confidence intervals and Wald tests for specified coefficients or contrasts. Finite-sample unbiasedness is not being asserted. A likelihood-ratio test compares nested fits through twice their maximized log-likelihood difference. The Poisson deviance against the saturated fit is
with . Residual diagnostics and a check of overdispersion assess whether the assumed Poisson variance is adequate; the variance correction required when it is not is derived in the next part.
For a homogeneous continuous-time Markov chain, the holding time in a living state before the next transition has survival probability , where . Indeed, conditional on still occupying that state, the probability of leaving in the next is , so its survival function satisfies and . Integrating gives the mean holding time from a transition intensity matrix:
This is the mean time until any allowed exit from that state, not necessarily the patient's remaining lifetime.
For confidence limits, use the supplied standard error of the corresponding diagonal generator estimate. Changing its sign does not change its standard error, so it is also the standard error of . The delta method, with derivative , gives
The resulting approximate 95% Wald confidence intervals are
The diagonal standard errors already incorporate the covariance among outgoing rates. They should not be replaced by the square root of a sum of squared off-diagonal standard errors, which would silently assume those rate estimates independent.
Alternatively construct a positive rate confidence interval and apply the confidence interval for an inverse rate transformation. Here every normal rate interval has a positive lower endpoint, giving
These approximate intervals are, respectively, , , and years. They are asymmetric because inversion is nonlinear; positive log-rate or likelihood-based intervals could also be inverted. The symmetric delta intervals and the inverted-rate intervals are two legitimate first-order approaches and need not have numerically identical endpoints.
The death state has zero exit rate, so its holding time is infinite. There is no finite mean-sojourn estimate or ordinary finite confidence interval for this structurally absorbing state. All intervals above concern the mean parameter, not a prediction interval for one patient's realized holding time.
The Wald test of uses
with an approximate standard normal distribution under the null. Its two-sided p-value is , and the approximate Wald confidence interval is
There 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.
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 is
The 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 when
Expanding gives
The leading coefficient is positive, since ; the effect increment is separated from zero at this level. With , the polynomial is approximately
It 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 , giving
The 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.
Each scan() command reads a numeric vector from the entered data: the first creates the nine counts, and the second their nine predictor values. The last command fits a generalized linear model with the Poisson distribution and its default log link, including an intercept, then prints a summary. Thus the model is independent counts with means satisfying
The coefficients are maximum-likelihood estimates, and the reported standard errors come from the inverse fitted Fisher information matrix. Increasing the predictor by one multiplies the fitted mean by , about a increase. The intercept corresponds to a mean at predictor zero, outside the observed range. Approximate coefficient-to-standard-error ratios are and ; the slope is strongly different from zero under the assumed model. A Wald confidence interval for the slope is about , or for the multiplicative change.
The deviance is twice the log-likelihood advantage of the saturated model over the fitted model. For these counts it is
with the logarithmic term interpreted as zero when a count is zero. The saturated model has nine freely fitted means; the fitted model has two independent regression coefficients, so the residual degrees of freedom are .
Under an adequate Poisson model and the usual large-sample approximation, is compared with . The reported is rather large relative to seven, but below the upper critical value about ; its approximate upper-tail probability is . Thus there is some indication of lack of fit or overdispersion, but not a rejection at the level on this diagnostic. The deviance-to-d.f. ratio is about ; it does not by itself prove an overdispersed model, and the chi-square approximation is imperfect for small counts.
There is one inconsistency in the supplied numerical output. Independently solving the Poisson score equations for the displayed nine counts gives , and deviance , agreeing with the printed estimates and deviance. But gives standard errors approximately and . In particular the printed slope standard error is not the standard Poisson-model value for these data. The interpretations above describe the supplied numbers; the directly recomputed slope ratio is and its normal-approximation interval is about . The conclusion of a strong increasing trend is unchanged.
The mean ratio is , so its logarithm is exactly ; the baseline coefficient cancels. Under the stated asymptotic normal approximation, the Wald confidence interval for is . Exponentiation is monotone and therefore preserves the interval's coverage event. Hence
The standard error of is not needed for this confidence interval: the Poisson regression already supplies the standard error of the contrast . It would be incorrect to combine the two reported standard errors as if the mean ratio depended on both coefficients independently.
Use grouped-binomial logistic regression, and . Center the year as . Maximizing gives score and information ; these determine the estimates and working covariance matrix.
A straight-line logit fit is , with naive binomial standard errors and . Its yearly odds multiplier is , with naive 95% Wald confidence interval . However, its residual deviance is on 12 degrees of freedom (), so those small standard errors do not describe an adequate independent-binomial fit.
Comparing polynomial mean structures gives residual deviances for degrees zero through three, with respective residual degrees of freedom . A quadratic term alone adds little; the cubic structure captures the middle-period acceleration and later leveling. Even the cubic independent-binomial fit has for its residual deviance goodness-of-fit test. A useful working model is therefore cubic quasibinomial regression, retaining the logistic mean and estimating overdispersion rather than claiming an exact binomial law:
The Pearson estimate is . Using standard errors multiplied by and a reference, the approximate 95% coefficient intervals are , , , and . An approximate quasi-deviance comparison of cubic against linear gives and , supporting the added shape while acknowledging that only fourteen annual groups inform dispersion.
In this preferred mean model the odds change is not constant:
The fitted annual change is larger around the middle than at the ends; the straight-line 4.6% increase is a useful overall summary, not an exact yearly effect in the cubic model. The fitted curve, uncertainty band and residual plot appear in the figure. Singleton success increased overall, but a constant log-odds trend with unit binomial dispersion fits poorly. Quasibinomial intervals remain working-model intervals: serial dependence, changing patient mix and treatment practices cannot be separated from annual aggregates alone.
The correct denominator is the number of live deliveries , not treatment cycles and not babies. Define and use ; this is the distinction in denominators in grouped birth-outcome models. The observed conditional multiple-delivery proportion is initially and finally.
A constant logit has residual deviance on 13 degrees of freedom. A linear-year fit gives , deviance on 12 degrees of freedom (), and annual odds ratio . A quadratic term improves the deviance by on one degree of freedom (), whereas a further cubic improvement is only (). A supported parsimonious binomial model is
Its residual deviance is on 11 degrees of freedom (), and Pearson statistic is , with no detected excess dispersion. The binomial standard errors are ; approximate 95% Wald confidence intervals are , , and . The annual odds multiplier is , describing near-flat early behaviour and a stronger later reduction, rather than a uniform annual decrease.
As a secondary check, modelling the triplet-or-higher share alone among deliveries needs curvature: its quadratic logit has residual deviance on 11 degrees of freedom, compared with for a straight line. Multiple delivery became less likely conditional on a live delivery, especially later in the series; higher-order multiples declined particularly strongly. This conditional probability is separate from the probability of any successful live delivery per cycle.
Figure 1.
Guerry reconstruction and complete IVF analyses, with clearly labelled bus and village excerpts
. Details.
Let be the disease count among miners in exposure group , with representative exposure , for . The grouped-binomial logistic regression is
The model assumes independent miners, a common disease probability within each group at its representative exposure, and binomial variation without an extra dispersion parameter. The use of average exposure is a grouping approximation, not a claim that every miner in a group has identical exposure. The input response is and weights=miners supplies the binomial denominators , not inverse variances; together they yield this count likelihood function. The default binomial link is the logit link.
For , the likelihood-ratio test compares the intercept-only model with the linear-exposure model. The reduction in binomial deviance is
Under the usual regular large-sample approximation it has a chi-squared distribution with one degree of freedom. There is very strong evidence of exposure dependence, with a positive estimated coefficient .
For goodness of fit against separate probabilities in all eight groups, the residual binomial deviance has approximately degrees of freedom. Its upper-tail probability is about , giving no evidence of lack of fit. This is an approximate check, particularly because the earliest exposure groups have small expected disease counts. It supports adequacy of this mean structure, not proof that all its assumptions or possible confounding variables have been addressed.
The predict call asks for a prediction at exposure , sets type="response" to return the fitted probability rather than its log odds, and requests the standard error of that fitted probability. It gives
For , the linear predictor is , and the delta method gives
The intercept-slope covariance is included in this expression. This measures uncertainty in the fitted mean probability; it is not the standard deviation of a new individual's binary disease outcome or of an unspecified new sample proportion.
The model's odds at exposure are . Hence , independently of . By invariance of maximum likelihood estimation, estimate this odds ratio by . A Wald confidence interval for is ; exponentiating its endpoints after multiplication by gives the interval for the multiplier. Using the printed coefficient and standard error yields
Thus the estimated odds rise by about per year, or by a factor about per decade. These are changes in odds, not fixed multiplicative changes in probabilities.
The second fit keeps the same independent binomial distributions but permits a quadratic linear predictor,
In the sequential analysis, each exposure term adds one coefficient. With the first model's deviances, all nine missing entries are recovered in this completed table:
The final reduction is , with rounding to the precision of the printed output. Testing therefore gives on one degree of freedom. At the significance level I would retain the simpler linear-exposure model: it already fits adequately and the extra curvature is not clearly established. The quadratic fit does improve the likelihood somewhat; its Akaike information criterion is about smaller, since . Thus different reasonable selection criteria may weakly prefer different models, but these data do not give strong evidence that the additional term is necessary.
Let indicate a depressed outcome and indicate the control arm. A logistic regression could specify
with containing prespecified baseline characteristics, including the stratification factor. Fit the coefficients by maximizing the likelihood for independent Bernoulli random variables . For equal covariate values the control-to-intervention odds ratio is . Thus an estimate produces the quoted adjusted ratio. An ordinary Wald confidence interval is obtained by exponentiating the endpoints of the coefficient's confidence interval.
The raw control-to-intervention odds ratio, using the actual counts, is
Using only the quoted percentages gives about , so both versions are approximately . The printed is not the usual whole-percentage rounding of ; using the counts avoids that small numerical inconsistency. The reversed intervention-to-control ratio is about .
The apparent surprise is a coding issue: with depression as the adverse outcome and intervention relative to control, protection would give an odds ratio below one. A ratio above one is favourable if the comparison is control relative to intervention, as above, or if the outcome has been recoded as absence of depression and intervention is compared with control. Both comparison and outcome must be specified. The adjusted ratio need not equal the crude one, even in a randomized trial: covariate adjustment and noncollapsibility of the odds ratio can change an odds ratio. Their close numerical values here do not prove that the regression adjustment was unnecessary.
Write the logistic regression as
where denotes elective exposure and contains the measured background predictors. At fixed , changing from zero to one changes the log odds by , so the adjusted odds ratio is . If is the estimated coefficient covariance matrix, then
Use the clinic-cluster sandwich covariance matrix if that is how within-clinic dependence is allowed for. The interval is first calculated on the coefficient scale and then exponentiated; one does not add and subtract a standard error directly from the odds ratio. This is a large-sample Wald confidence interval; profile-likelihood limits are another option when the likelihood shape warrants them. If exposure interacts with background variables, there is no single common conditional odds ratio: its logarithm includes the corresponding interaction terms.
Let be the accident count at location in period , and its exposure in years, where denotes after installation. The Poisson exposure model is
The offset has its coefficient fixed at one. The model assumes constant rates within each period, a common before rate across locations, a common treatment rate ratio, independent counts, and Poisson variance equal to the mean. The incidence rate ratio is , so
An approximate 95% Wald confidence interval transforms the interval for :
In the species-only model, the log odds for adult species A is the intercept, so with standard error 0.07824. This also follows directly by pooling its vials: there are 570 other-species eggs among 799 eggs eaten, giving and
For a regular maximum-likelihood estimator, asymptotic normality of a maximum likelihood estimator gives , with information . Substitution of gives . An approximate 95% Wald confidence interval is
This interval treats the selected species-only model as fixed; it does not account separately for uncertainty from choosing that model.
The coefficient labelled yr2 identifies year as a factor. With in the first year and in the second, the Poisson regression assumes independent daily counts conditional on year,
The unknown mean statistical parameters are the first-year log daily rate and the second-year log rate ratio ; the dispersion parameter is fixed at one. Approximate 95% Wald confidence intervals are
Exponentiating yields the first-year fitted daily mean , with confidence interval , and
The second-year fitted daily mean is . Thus this Poisson regression estimates a 9.35% fall, with an approximate interval for the percentage fall from 3.66% to 14.70%. These confidence intervals rely on the Poisson distribution and independence assumptions.
This is a generalized linear model with independent Bernoulli distributions for the responses and the logit link. Under treatment coding with colour one as the reference level, the linear predictor is
Colour is a categorical variable, not a numerical trend. Width has the same slope for every colour, since no interaction term is fitted. The parameters are estimated by maximum likelihood estimation.
The approximate Wald confidence interval for the width coefficient is , or approximately . This uses the approximate normal distribution of the maximum-likelihood estimator, rather than a confidence interval for an individual binary response.
For the requested crab, the fitted linear predictor is . Applying the inverse logit link gives . The rounded displayed coefficients need not reproduce the reported test statistics exactly.