Sample size required to to compare an odds ratio from logistic regression to 1. The model is of a continuous explanatory variable and a binary outcome variable. The OR is for a one-standard-deviation (SD) increase in the continuous explanatory variable.
Instructions: Enter parameters in the green cells. Answers will appear in the blue box below.
OR
Odds ratio
q1
Proportion of sample in group 1
q0
0.90
Proportion of sample in group 0
S
1
Standard deviation; set to 1
α (two-tailed) =
Threshold probability for rejecting the null hypothesis. Type I error rate.
β =
Probability of failing to reject the null hypothesis under the alternative hypothesis. Type II error rate.
1. Sample size for single independent variable:
n1(Raw) = Raw calculation (i.e., without VIF) for size of group 1 = . The calculator seeks a value of n1 such that the equations below will yield a probability of tα (given DF and NCP) that is equal to the value of β you selected above.
n0(Raw) = Raw size of group 0 = (q0/q1) * n1(Raw) = .
DF = Degrees of freedom = n1(Raw) +n0(Raw) - 2 =
tα = Inverse of the two-tailed T distribution given probability of 1-(α/2) and DF of =
Probabilty from the non-central t distribution of tα, given DF and NCP above = . (If n1(Raw) is calculated correctly, this should closely approach the value of β you selected above.)
n1(Raw) and n0(Raw) are rounded up to next highest integer.
n1(Raw):
n0(Raw):
nTotal(Raw):
2. Calculation using Variance Inflation Factor:
If your logistic regression model only has 1 continuous explanatory variable x1, then you do not need to account for the increase in variance due to other explanatory variables. Just set ρ2 to 0 and your VIF will be 1. But if you have other explanatory variables x2, x3, ... xk in your model, the standard error of your coefficient estimate will be larger, which means you won't be able to detect as small an effect size. The amount by which the standard error increases depends on the correlation between the continuous explanatory variable of interest (x1) and the other explanatory variables (x2, x3, ... xk). To estimate this, fit a multiple linear regression model with the continuous x1 as the outcome and x2, x3, ... xk as the explanatory variables. Use R2 from this model as your estimate of ρ2. The VIF (which we will calculate for you) is 1/(1-ρ2).
ρ2
VIF = 1/(1-ρ2) =
n1(VIF) = round-up(n1(Raw) * VIF) =
n0(VIF) = round-up(n0(Raw) * VIF) =
nTotal(VIF) = n1(VIF) + n0(VIF) =
Reference:
Chow S-C, Shao J, Wang H. Sample size calculations in clinical research. 2nd ed. Boca Raton: Chapman & Hall/CRC; 2008. Section 3.2.1, page 58.
Hsieh FY, Bloch DA, Larsen MD. A simple method of sample size calculation for linear and logistic regression. Stat Med. 1998;17(14):1623-34.