Skip to main content

    Method document

    Sample size to estimate a risk ratio per standard deviation

    How many participants are needed to estimate how much the risk or prevalence of a binary outcome changes per standard deviation of a numerical predictor, from modified Poisson regression with robust standard errors, within a chosen factor. Allows for other covariates. Covers non-response.

    Engine version 1.0.0 · Reviewed 4 October 2026

    https://statwisely.com/methods/precision-rr-per-sd/

    When to use it

    • A cohort or cross-sectional study reporting the risk or prevalence ratio for a measured predictor, such as age or a biomarker, when the ratio with its interval is the aim.

    Not for

    • A common outcome with a strong effect, where the risk would pass 1 for participants far above the mean; a log-linear risk model does not fit, and the calculator refuses it.
    • An odds ratio. Use the odds ratio per SD.

    Notation

    nn
    Number of participants
    pp
    Risk of the outcome at the predictor’s mean
    ff
    Precision factor: the interval runs from RR / f to RR × f
    RX∣Z2R^{2}_{X|Z}
    Share of the predictor’s variance explained by the other covariates
    V(β)V(\beta)
    Per-participant robust variance of the log risk ratio per SD
    z1−α/2z_{1-\alpha/2}
    Standard normal quantile for confidence 1 − α (1.960 for 95%)
    qq
    Non-response rate

    Formulas

    Small effects: a closed form

    n=⌈z1−α/22(ln⁡f)2⋅1−pp⋅11−RX∣Z2⌉n = \left\lceil \frac{z_{1-\alpha/2}^{2}}{(\ln f)^{2}} \cdot \frac{1-p}{p} \cdot \frac{1}{1-R^{2}_{X|Z}} \right\rceil

    With a binary outcome analysed by Poisson regression and robust errors, the slope of a standard-normal predictor has variance (1 − p)/p per participant when the effect is small [1].

    At an expected risk ratio

    V(β)=[A−1BA−1]ββ,A=E ⁣[μ zz⊤],B=E ⁣[μ(1−μ) zz⊤],μ=p RRxV(\beta) = \left[A^{-1} B A^{-1}\right]_{\beta\beta}, \quad A = E\!\left[\mu\, z z^{\top}\right], \quad B = E\!\left[\mu(1-\mu)\, z z^{\top}\right], \quad \mu = p\,\mathrm{RR}^{x}

    Given the expected risk ratio, the sandwich variance of the modified-Poisson slope is integrated over the predictor by Gauss–Hermite quadrature, with z = (1, x). A rising risk means more events, so the plan can be smaller than the closed form.

    Non-response

    napproach=⌈n1−q⌉n_{\text{approach}} = \left\lceil \frac{n}{1 - q} \right\rceil

    The number to approach so that n respond. Applied last, after any clustering.

    Parameters

    Confidence level1−α1-\alpha

    Values: 90%, 95% or 99%

    95% is the convention in health research. A higher level widens the interval, so the same margin needs a larger sample.

    Precision factorff

    Values: Above 1

    1.25 means the interval runs from RR / 1.25 to RR × 1.25.

    Risk at the predictor’s meanpp

    Values: Between 0 and 1

    A rare outcome needs many more participants: the variance grows as (1 − p)/p.

    Expected risk ratio per SDRR\mathrm{RR}Optional

    Values: Above 0; empty for a small effect

    Sent to the engine under the shared name odds_ratio.

    R² of the predictor on the other covariatesRX∣Z2R^{2}_{X|Z}Optional

    Values: At least 0 and below 1

    0 with no other covariates.

    Expected non-response rateqqOptional

    Values: 0% up to, but not including, 100%

    The share of people approached who will not take part; use the response rate of a comparable study. Approaching more people restores the number of respondents, not their representativeness: if non-responders differ, the estimate can still be biased.

    Assumptions

    • Participants are independent, the predictor is approximately normal, and the log risk changes linearly with it.
    • Non-response is unrelated to the outcome.

    Worked examples

    A 10% risk, small effect

    A risk of 0.1 at the mean, factor 1.25: 3.8415 × 9 / (ln 1.25)² = 694.2, so n = 695.

    Sample size: 695

    Open this example in the calculator

    Planning at the expected effect

    Expecting a risk ratio of 1.5 per SD, more events occur among those above the mean: n = 605.

    Sample size: 605

    Open this example in the calculator

    A more common outcome

    A risk of 0.3: (1 − p)/p falls from 9 to 2.33, so n = 181.

    Sample size: 181

    Open this example in the calculator

    Validation

    • Every worked example on this page is recomputed by the StatWisely engine whenever the software is built. If a number or formula here stopped matching the calculator, the release would be stopped until this document was corrected.
    • At no effect the quadrature reproduces (1 − p)/p exactly. In R, Poisson glm fits with sandwich::vcovHC standard errors on simulated samples at the planned sizes gave median interval factors of 1.246 to 1.248 against a target of 1.25, both at no effect and at expected risk ratios of 1.3 and 1.5. An independent R integration of the sandwich variance reproduces the engine’s sizes.

    How to cite

    StatWisely. Sample size to estimate a risk ratio per standard deviation. Method document, engine version 1.0.0, reviewed 2026-10-04. https://statwisely.com/methods/precision-rr-per-sd/

    Cite the original references for the formulas your design uses as well.

    References

    1. 1.Zou G. A modified Poisson regression approach to prospective studies with binary data. American Journal of Epidemiology. 2004;159(7):702–706. doi:10.1093/aje/kwh090