Case–control study 2026-10-14
A case–control study selects subjects according to an outcome: cases have the outcome and controls represent an appropriate comparison population. It compares their prior exposures or genetic variants to study association. Its retrospective sampling must be accounted for when interpreting risks; selection bias and confounding can distort an unadjusted association. In genetics, matched family pseudo-control genotypes can replace unrelated controls for a conditional transmission disequilibrium test.
Case mix 2026-10-14
Case mix describes the distribution of patient characteristics affecting prognosis, such as age, severity, comorbidity and urgency. Comparing provider outcomes without accounting for case mix may confuse differences in patients with differences in care. Adjustment requires comparable, reliably measured baseline variables and does not remove all possible confounding.
Cross-sectional study 2026-10-14
A cross-sectional study measures different individuals during one observation period. Differences between ages can reflect confounding or birth-cohort differences as well as changes within individuals; a longitudinal study is needed to measure the latter directly.
Intention-to-treat analysis Created 2026-10-07 Updated 2026-10-14
An intention-to-treat analysis compares participants according to their randomized assignment, retaining that assignment even when they do not use the assigned intervention. Its causal effect is the effect of assignment under the study's actual adherence pattern, rather than the effect of perfect adherence. Randomization protects this comparison from baseline confounding; missing data can still require assumptions or additional analysis.
Multiple linear regression models a scalar response by an intercept and several predictors. It is linear in the regression coefficients, even when predictors include transformed variables or interactions. In an observational study, adjustment can address measured confounding, but does not automatically identify a causal effect. Improvements in fitted coefficient of determination require external predictive assessment rather than being treated as proof of improved future prediction.
A conditional odds ratio can differ from the marginal odds ratio after averaging over a predictor, even without confounding. If conditional risks are , averaging gives , and odds of are generally not averages of the conditional odds. Consequently a common conditional odds multiplier need not equal the marginal odds multiplier. However, if both groups use the same distribution and everywhere, then and the marginal odds ratio is still above one. Noncollapsibility alone cannot reverse a uniformly signed effect under an identical background distribution.
Observational study 2026-09-28
An observational study measures exposures and outcomes without assigning the exposure by an intervention. Its causal interpretation therefore requires assumptions that address confounding and selection bias.
The output must first identify the response scale and the formula. If the initial fit is ordinary least squares to the untransformed response with all fifteen predictors and an intercept, its normal linear model is
For full rank , the residual degrees of freedom are . The residual standard error is and estimated coefficient covariance is . A coefficient test divides the estimate by its standard error and compares with a reference distribution; the overall test of all fifteen slopes compares
with . The intercept-only residual sum is . Adjusted R-squared penalizes the loss of residual degrees of freedom, unlike ordinary .
Each regression coefficient measures a conditional association holding the other columns fixed. The southern-state indicator compares two state categories at equal values of all other predictors. Rescaling changes the units of a coefficient, so one cannot infer effects per original currency unit or per original percentage unit without the scaling information. If the actual formula uses , exponentiating a coefficient gives a multiplicative response change rather than an additive change; if both response and a predictor are logged, the slope is an elasticity. These interpretations cannot be interchanged.
The two police-expenditure variables are likely strongly associated and need a multicollinearity check: individual coefficients can be unstable even when their joint contribution predicts well. Their actual correlation should be calculated, not presumed numerically. Similar considerations apply to age-specific unemployment. With only 47 observations and up to 16 mean parameters, examine regression leverage, Cook's distance, residual distribution, variance versus fitted values, nonlinear effects and predictive cross-validation. State-level geographical dependence may also violate the independent-error model.
The observations are aggregate states. An association between a state covariate and crime rate is not an individual causal effect: ecological fallacy, confounding and reverse causation are relevant. For example, greater recorded crime can induce greater police expenditure. The absent coefficient table and model call prevent deciding which predictors were significant or even whether the fitted response was transformed. The preceding degrees of freedom and formula interpretations are conditional on the explicitly stated full linear-model specification.
Four distinct objections, each with a corresponding improvement, are as follows.
  • Different patients imply different baseline risks. Raw death rates confound performance with case mix, including urgency, disease severity and comorbidity. Use a prespecified, validated risk-adjusted provider comparison, standardizing to comparable patients or comparing observed deaths with . Check overlap and model calibration rather than assuming adjustment removes all confounding.
  • Small annual volumes produce unstable rankings. A few deaths can move a surgeon far up or down a league table; zero deaths need not indicate zero risk. Display counts and suitably calibrated confidence intervals for binomial proportions, preferably in funnel plots against volume. Pool suitable periods or use a hierarchical Bayesian model to stabilize estimates, while allowing genuine time changes.
  • Many simultaneous comparisons generate chance outliers. With independent null comparisons, the probability of at least one false positive is , and ranks amplify selection of extremes. Use multiple testing adjustments or simultaneous control limits and seek confirmation before interpreting an apparent outlier. Dependence through the national comparator must also be accounted for.
  • The endpoint and unit of attribution can mislead. In-hospital death depends on discharge and transfer policy, and care is delivered by a team; follow-up after discharge is omitted. Use an independently audited fixed-horizon endpoint, such as a prespecified 30-day mortality outcome, linked across hospitals and to death registrations, and report an appropriate team or institutional comparison alongside any surgeon-level estimate. Reliable attribution and consistent inclusion criteria reduce incentives to manipulate coding or case selection.
A confidence interval containing the national rate does not demonstrate equivalence, and a raw ranking does not establish a causal performance difference. The improved presentation should convey precision and uncertainty as well as the estimated outcome.
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 is
Let indicate some use and indicate predisposition. The additive logistic regression specifies . Its log-likelihood, including the binomial constants, is
Differentiation 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 are
These 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.
Use a longitudinal study with repeated measurements of the same individuals. Recruit people across several starting ages and measure the same ear, with a standardized anatomical definition and instrument, at baseline and subsequent visits over several years. Repeat measurements at each visit to estimate measurement error; where practical, conceal previous measurements from the observer. Record sex, body size, birth cohort and observer, and document reasons for loss to follow-up.
A simple random-intercept linear mixed model for ear length at elapsed follow-up time is
The individual intercept absorbs persistent differences between people. Alternatively, differences remove that intercept directly. Estimate the within-person regression coefficient and its confidence interval, accounting for the correlation of repeated measurements. Compare it with the cross-sectional slope rather than treating the two slopes as automatically identical.
This longitudinal study directly checks whether an individual's ears tend to lengthen as time passes. Several entry-age cohorts help assess whether the change varies with starting age. Calendar-period changes and selective dropout can still affect interpretation, so repeated observation alone does not eliminate every possible source of confounding or selection bias.
A cross-sectional age association need not equal within-person growth. The following alternatives each suggest a concrete extension of the study.
  • Birth-cohort differences. Older participants were born in a different period. Persistent differences established early in life could produce a positive age slope even if every person's adult ear length were constant. Repeat measurements in a longitudinal study of several birth cohorts, separating within-person changes from differences in their initial measurements. Calendar age, birth year and observation year are algebraically related, so all three unrestricted linear effects cannot be identified without additional assumptions.
  • Confounding by sex, body size or ancestry. Suppose a characteristic is associated both with ear length and with age among the sampled patients. Omitting it then changes the apparent age slope. Measure these characteristics, examine their distributions across ages, and fit a multiple linear regression or compare age slopes within appropriately defined groups. A guessed overall sex proportion supplies none of the required age-by-sex information.
  • Selection bias from attendance or consent. Consulting patients and people willing to be measured may differ from the general population. For example, attendance could select different combinations of age and body characteristics. Sample from a population register, recruit people regardless of consultation, record refusals and compare age-specific recruitment patterns; compare the resulting slope with the practice-based slope.
  • Survivorship bias. Ear length or a correlated characteristic might be associated with survival. Then people with larger ears could be overrepresented among older survivors even without growth. Follow a population cohort, measure ears before subsequent deaths or dropout, and investigate whether survival or retention depends on initial ear length after accounting for age and other covariates. This tests the proposed selection mechanism rather than assuming it.
  • Age-related measurement error. Different practitioners may see different age mixes and have different measurement offsets; observers might also measure older ears differently. Use one protocol, calibrate instruments, randomly allocate observers where possible, conceal previous readings, obtain duplicate independent measurements and record observer identity. Analyze observer effects and the repeat-measurement differences before interpreting an age slope biologically.
These explanations are hypotheses to be checked, not established facts about the participants. Neither a small p-value nor an approximately linear scatter plot excludes them.
Measure receipt and transfers directly rather than inferring them only from the outcome difference. Use identifiable pack codes and confidential early follow-up to record whether packs were retained, lost, taken, given away or administered, and to whom. Where feasible, corroborate administration reports with care records and establish whether recipients belonged to the opposite randomized group.
A process-evaluation sample across both arms can estimate the frequency and direction of treatment contamination. Separate receipt tracking from blinded outcome ascertainment where possible. Keep randomized assignments for the primary intention-to-treat analysis: excluding transfers or reclassifying participants by receipt can introduce confounding, since receipt behavior is not randomized. Receipt data can inform a supplementary analysis whose additional assumptions are explicit.
For rare events, is approximately . The binomial variance is , close to the Poisson variance , and is close to . Even the largest observed proportion here is below . Thus the binomial log-odds model and Poisson log-rate model should give similar fitted counts and tests, as their very similar deviances show.
Both analyses indicate strong age and adjusted city associations, with no apparent large residual lack of fit. The binomial model is natural when each person can contribute at most one case during a fixed period and the denominator counts people at risk. A Poisson count model is natural for event counts with an appropriate exposure or person-time denominator; population size is an approximation to such exposure if the observation periods are comparable. An odds ratio and a rate ratio are different parameters despite being close in this rare-event setting.
The models both assume a common city effect across ages. An age-by-city interaction can be checked by comparing with the saturated model for the 15 observed cells, using the six additional degrees of freedom; the small final deviances offer no substantial evidence against the additive fits in that comparison. This cannot recover the missing city-by-age cell or eliminate unmeasured confounding. Nor is choosing the lower of and a valid model-selection rule: these deviances are measured against saturated models for different response distributions.
There is an apparent reversal, but not a mathematical contradiction. The crude odds ratio averages over the actual background distribution in each group, whereas the adjusted logistic regression compares groups at the same fitted background values. Strong confounding could make those distributions very different: for example, elective patients might disproportionately come from low-risk backgrounds or clinics, while the reference patients come from higher-risk backgrounds. The Simpson paradox can then reverse the marginal comparison even when every conditional comparison favours the same direction.
The noncollapsibility of the odds ratio can also make marginal and conditional odds ratios differ in magnitude. It does not, by itself, explain a sign reversal if both groups have the same covariate distribution and the common conditional effect has one sign: if for every , averaging over the same distribution of still gives a larger exposed risk. A genuine reversal therefore requires differing background distributions, heterogeneous effects or another change in what is being compared. The observed reversal is a reason to investigate these issues, not proof of a programming error.
The groups were not formed by randomization. Their background health, access to care, clinic, country and reasons for selecting a delivery method can predict both the method and the outcome, creating confounding and selection bias. Moreover, the label describing the reference delivery may be determined after labour: patients whose attempted nonoperative delivery develops a complication can move into an operative category, leaving a selected uncomplicated reference group. Comparing intended strategies would avoid treating this post-baseline classification as a baseline assignment.
A useful comparison would therefore align eligibility and follow-up time, compare intended delivery strategies among patients genuinely eligible for both, and account for sufficient pretreatment predictors. Logistic regression cannot create comparable patients where the positivity assumption fails or remove unmeasured confounding.
The displayed information does not establish increased maternal mortality caused by elective exposure. There are no observed deaths in that group, and the reported adjusted estimate concerns a composite adverse outcome, not death alone. A composite can show an association driven by nonfatal components without identifying a mortality effect.
If the logistic regression and its adjustment are correct, its confidence interval supports an adjusted association with the composite outcome. Calling that association a causal increase in risk additionally requires a defensible comparison group, adequate control of confounding, valid outcome classification and a well-defined intervention. The crude result is in the opposite direction, and the implied very low counterfactual baseline risk deserves examination. Conversely, zero deaths does not prove absence of harm. The justified conclusion is an association conditional on model and study assumptions, with mortality and morbidity distinguished.
A reversal this large calls for an audit, but the aggregate table cannot identify a particular error. Check the outcome and exposure coding, the reference category, the subset used in each analysis, missing-data exclusions, denominators, weights, and whether the reported coefficient actually corresponds to the intended comparison. Reversing an exposure contrast or exponentiating the wrong fitted coefficient would change the reported odds ratio. Conditioning on variables affected by delivery, or including inappropriate interactions, could also change the causal inference rather than merely improve precision.
Start by reproducing the crude odds ratio from an independent two-by-two calculation. Then fit progressively adjusted logistic regressions, recording how the coefficient and analysis population change; inspect within-clinic comparisons, sparse cells and separation. For an ordinary likelihood fit, check the fitted expected event count against the observed count and verify that changing only to cluster-robust standard errors leaves the fitted coefficients unchanged. A sandwich covariance matrix corrects uncertainty for clustered data; it does not by itself turn a crude odds ratio below one into an adjusted odds ratio above one. Adding clinic effects, using weights or changing the model can change the point estimate and must be distinguished from that variance correction.
Programming or reporting error is a possibility to check, not a conclusion proved by the reversal. Strong legitimate confounding remains another explanation.