Power and Sample Size Calculations with R
Section outline
-
Power and Sample Size Workshop
Workshop Overview
In this workshop, we will provide a brief review of the concepts underlying power and sample size analysis. Following this, we will use R for hands-on programming practice with power and sample size calculations for several different types of analyses, including parametric and nonparametric tests using both analytical and simulation approaches.
Learning Objectives
By the end of the workshop, participants should:
- Become familiar with concepts such as type I and II error, effect sizes, and confidence intervals
- Know how to do power and sample size calculations for several common study designs and tests
- Know how to create power and sample size plots from grid searches
- Know how to use simulations for more complex analyses
Prerequisites
A basic understanding of statistics and the purpose of doing power and sample size calculations, and familiarity with R programming will be helpful but not required.
Software
This course uses R and RStudio. Please have these installed on your laptop prior to the workshop.InstructorsAlan Paciorek is a Biostatistician with the UCSF Helen Diller Family Comprehensive Cancer Center, and a Programmer Analyst in the UCSF Deptartment of Epidemiology & Biostatistics.Karla Lindquist, PhD is the Scientific Lead for the Data Science Initiative in the UCSF Library.Materials
All materials here are subject to periodic updates by the Instructor. Content on this website reflects the material taught during the most recently offered live workshop.
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License
Upcoming Sessions
Please check the library calendar to see when this course will be offered next. You can also sign up for the Library Data Science Newsletter to get notified when new courses are added to the schedule.
Also check out the workshops offered under Programming and Bioinformatics, and by the Gladstone Institute.
-
Examples of other packages that can do more complex power/sample size calculations:
- For microarray experiments: https://bioconductor.org/packages/release/bioc/vignettes/sizepower/inst/doc/sizepower.pdf
- For complex survey designs: https://cran.r-project.org/web/packages/samplesize4surveys/vignettes/Power-and-sample-size.html
Alan Paciorek's effect size calculator for 2-way contingency tables (Excel spreadsheet) - For microarray experiments: https://bioconductor.org/packages/release/bioc/vignettes/sizepower/inst/doc/sizepower.pdf