Sample Size Planning with Methods Text and References

Sample size calculations for the study designs most used in health and social research: estimating a proportion or mean (with finite-population correction and design effect), comparing two groups (proportions, means, paired data), case-control and cohort studies, diagnostic accuracy, Buderer (1996) , correlation and regression, one-way and repeated-measures analysis of variance, logistic regression, Hsieh, Bloch and Larsen (1998) , survival, Schoenfeld (1983) , incidence rates, non-inferiority and equivalence trials, longitudinal designs, Diggle, Heagerty, Liang and Zeger (2002, ISBN:9780198524847), and cluster-randomised trials with unequal cluster sizes, Eldridge, Ashby and Kerry (2006) , with adjustment for several primary outcomes and for nonresponse. Each result can be turned into a ready-to-use methods paragraph that states every assumption, the target before and after nonresponse and the adjustments made, with the formula and references. The same calculations power the sample size calculator at < https://researchite.com/sample-size>.


researchite

Sample size calculations for the study designs most used in health and social research, each with a ready-to-use methods paragraph: every assumption, the target before and after nonresponse, the adjustments made, the formula and the references.

The same calculations power the free sample size calculator at researchite.com/sample-size, so a student gets the same number in R and in the browser.

Installation

install.packages("researchite")

Example

library(researchite)

# A cross-sectional survey: prevalence about 50%, +/- 5 percentage points,
# multistage sampling (design effect 1.5) and 10% nonresponse
x <- ss_proportion(p = 0.5, precision = 0.05, deff = 1.5, nonresponse = 0.1)
x
#> Sample size: Estimating a single population proportion
#>
#>   642 participants
#>   (577 completed observations, before 10% nonresponse)

cat(methods_text(x))
#> The sample size was calculated for estimating a single population
#> proportion. Assuming an expected proportion of 50%, 95% confidence and an
#> absolute precision of 5 percentage points, 577 completed observations are
#> required. After allowing for 10% nonresponse, the recruitment target is 642
#> participants. No finite-population correction was applied, and a design
#> effect of 1.5 was applied for the sampling design. ...
#>
#> References:
#> Cochran WG (1977). Sampling Techniques, 3rd ed. New York: Wiley.
#> ...

What it covers

Purpose Functions
Estimating a quantity ss_proportion(), ss_mean(), ss_sensitivity(), ss_specificity()
Comparing groups ss_two_proportions(), ss_two_means(), ss_paired(), ss_one_proportion(), ss_one_mean(), ss_mcnemar(), ss_anova()
Epidemiological studies ss_case_control(), ss_cohort(), ss_incidence_rates(), ss_logistic(), ss_logrank(), ss_correlation()
Trials ss_noninferiority_means(), ss_noninferiority_proportions()
Measured over time ss_repeated_within(), ss_repeated_groups(), ss_ancova()
Clusters design_effect(), ss_cluster_means(), ss_cluster_proportions()
Writing it up methods_text(), formula_text(), references()

Test-based calculations can allow for several primary outcomes (Bonferroni, or co-primary outcomes that must all succeed), and the t-test options use the exact noncentral t-distribution.

How it is checked

The tests compare the results with base R (power.t.test(), power.prop.test(), the noncentral F distribution), with textbook values, and with the researchite.com calculator. During development the package was also compared with the pwr, longpower and presize packages.

Citation

citation("researchite")

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("researchite")

0.1.0 by Tesfahun Mulatu, 6 days ago


https://researchite.com/sample-size


Report a bug at https://researchite.com/contact


Browse source code at https://github.com/cran/researchite


Authors: Tesfahun Mulatu [aut, cre, cph]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports stats, utils

Suggests testthat


See at CRAN