Sample size and power when comparing binary outcomes.
epi.sscompb(N = NA, treat, control, n, power, r = 1, design = 1,
sided.test = 2, nfractional = FALSE, conf.level = 0.95)
A list containing the following:
the total number of subjects required for the specified level of confidence and power, respecting the requirement for r
times as many individuals in the treatment group compared with the control group.
the total number of subjects in the treatment group for the specified level of confidence and power, respecting the requirement for r
times as many individuals in the treatment group compared with the control group.
the total number of subjects in the control group for the specified level of confidence and power, respecting the requirement for r
times as many individuals in the treatment group compared with the control group.
the power of the study given the number of study subjects, the expected effect size and level of confidence.
the proportion in the treatment group divided by the proportion in the control group (a risk ratio).
scalar integer, the total number of individuals eligible for inclusion in the study. If N = NA
the number of individuals eligible for inclusion is assumed to be infinite.
the expected proportion for the treatment group (see below).
the expected proportion for the control group (see below).
scalar, defining the total number of subjects in the study (i.e., the number in the treatment plus the number in the control group).
scalar, the required study power.
scalar, the number in the treatment group divided by the number in the control group.
scalar, the estimated design effect.
use a one- or two-sided test? Use a two-sided test if you wish to evaluate whether or not the outcome proportion in the exposed (treatment) group is greater than or less than the outcome proportion in the unexposed (control) group. Use a one-sided test to evaluate whether or not the outcome proportion in the exposed (treatment) group is greater than the outcome proportion in the unexposed (control) group.
logical, return fractional sample size.
scalar, defining the level of confidence in the computed result.
The methodology in this function follows the approach described in Chapter 8 of Woodward (2014), pp. 295 - 329.
With this function it is assumed that one of the two proportions is known and we want to test the null hypothesis that the second proportion is equal to the first. Users are referred to the epi.sscohortc
function which relates to the two-sample problem where neither proportion is known (or assumed, at least).
Because there is much more uncertainty in the two sample problem where neither proportion is known, epi.sscohortc
returns much larger sample size estimates. This function (epi.sscompb
) should be used in particular situations such as when a politician claims that at least 90% of the population use seatbelts and we want to see if the data supports this claim.
A finite population correction factor is applied to the sample size estimates when a value for N
is provided.
Fleiss JL (1981). Statistical Methods for Rates and Proportions. Wiley, New York.
Kelsey JL, Thompson WD, Evans AS (1986). Methods in Observational Epidemiology. Oxford University Press, London, pp. 254 - 284.
Woodward M (2014). Epidemiology Study Design and Data Analysis. Chapman & Hall/CRC, New York, pp. 295 - 329.
## EXAMPLE 1 (from Woodward 2014 Example 8.12 p. 312):
## A government initiative has decided to reduce the prevalence of male
## smoking to, at most, 30%. A sample survey is planned to test, at the
## 0.05 level, the hypothesis that the percentage of smokers in the male
## population is 30% against the one-sided alternative that it is greater.
## The survey should be able to find a prevalence of 32%, when it is true,
## with 0.90 power. How many men need to be sampled?
epi.sscompb(N = NA, treat = 0.30, control = 0.32, n = NA, power = 0.90,
r = 1, design = 1, sided.test = 1, nfractional = FALSE, conf.level = 0.95)
## A total of 4568 men should be sampled: 2284 in the treatment group and
## 2284 in the control group. The risk ratio (that is, the prevalence of
## smoking in males post government initiative divided by the prevalence of
## smoking in males pre inititative) is 0.94.
## EXAMPLE 2:
## If we sample only 2000 men (1000 in the treatment group and 1000 in the
## control group) what is the maximum detectable risk ratio that is less
## than 1?
epi.sscompb(N = NA, treat = NA, control = 0.32, n = 2000, power = 0.90,
r = 1, design = 1, sided.test = 1, nfractional = FALSE, conf.level = 0.95)
## If we sample only 2,000 men the maximum detectable risk ratio will be 0.91.
Run the code above in your browser using DataLab