Method document
Sample size for one coefficient in a linear regression
How many participants are needed to show that one predictor is associated with the outcome after allowing for the others in the model, from its expected partial correlation. Covers dropout.
https://statwisely.com/methods/regression-coefficient/
When to use it
- The usual question in an adjusted analysis: is this exposure associated with the outcome, given the confounders?
Not for
- Testing the model as a whole. Use multiple linear regression.
Notation
- Number of participants
- Number of predictors in the model, including this one
- Partial correlation of the predictor with the outcome
- Cohen’s effect size, r_p² / (1 − r_p²)
- Noncentrality of the F distribution
- Significance level: the chance of a false positive
- Power: the chance of detecting the effect if it is real
- Expected dropout
Formulas
The smallest N with enough power
One coefficient has one numerator degree of freedom, while the denominator still pays for every predictor. StatWisely takes λ on the residual degrees of freedom, which is slightly more conservative than G*Power’s λ = f²N and can give a few more participants [1].
Dropout
Applied last, to the participants actually recruited.
Parameters
Partial correlation
Values: Between −1 and 1, not 0
The correlation of the predictor with the outcome after both are adjusted for the other predictors, from a comparable adjusted analysis.
Number of predictors in the model
Values: A whole number of at least 1
Count every term in the model, including indicator variables for categories and any interactions.
Significance level
Values: Between 0 and 1; usually 0.05
The false-positive rate you accept. A smaller α, for example to allow for several primary outcomes, needs a larger sample.
Power
Values: Between 0 and 1; usually 0.80 or 0.90
The chance of a significant result if the assumed effect is real. Funders and ethics committees commonly expect at least 0.80.
Expected dropoutOptional
Values: 0% up to, but not including, 100%
The share of participants expected to provide no outcome, from comparable studies. Recruiting more restores the numbers, not the comparability of the groups: if dropout is related to the outcome, the estimate can still be biased.
Assumptions
- Participants are independent; residuals are roughly normal with constant variance.
- Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.
Worked examples
One exposure, two confounders
Partial correlation 0.3, so f² = 0.099, in a model of 3 predictors: N = 86.
Sample size: 86
Open this example in the calculatorProtocol statement
To detect a partial correlation of 0.3 with 80% power at a significance level of 0.05, using the test of one coefficient in a linear regression with 3 predictors, the required sample size is 86 participants. Calculated with StatWisely (statwisely.com) using: N: solve the noncentral-F test of one coefficient, df₁=1 and df₂=N-p-1, with λ=f²·df₂. These are planning estimates; confirm the final design with a qualified statistician.
More confounders
The same partial correlation in a model of 8 predictors: N = 91.
Sample size: 91
Open this example in the calculatorAllowing for missing data
Expecting 10% to have incomplete data: 86 / 0.9 = 95.6, so 96 are recruited.
Needed for analysis: 86 · To recruit: 96
Open this example in the calculatorProtocol statement
To detect a partial correlation of 0.3 with 80% power at a significance level of 0.05, using the test of one coefficient in a linear regression with 3 predictors, the required sample size is 86 participants. Allowing for 10% dropout, 96 participants should be recruited. Calculated with StatWisely (statwisely.com) using: N: solve the noncentral-F test of one coefficient, df₁=1 and df₂=N-p-1, with λ=f²·df₂. These are planning estimates; confirm the final design with a qualified statistician.
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.
- An independent implementation in R recomputes this test every night and before each production release, and the results are compared with the engine’s.
How to cite
StatWisely. Sample size for one coefficient in a linear regression. Method document, engine version 1.0.0, reviewed 2026-10-01. https://statwisely.com/methods/regression-coefficient/
Cite the original references for the formulas your design uses as well.
References
- 1.Cohen J. Statistical Power Analysis for the Behavioral Sciences. 2nd ed. Hillsdale, NJ: Lawrence Erlbaum Associates; 1988.