getSampleSize: getSampleSize

View source: R/reportSeverity.R

getSampleSizeR Documentation

getSampleSize

Description

Implements sample size calculations in R See also: https://www.cyclismo.org/tutorial/R/power.html and https://influentialpoints.com/Training/statistical_power_and_sample_size.htm

Usage

getSampleSize(mu0, mu1, alpha, beta, sigma, alternative = "greater")

Arguments

mu0

mean value of the null hypothesis (usually referred to as H0)

mu1

mean value of the alternative hypothesis (usually referred to as H1)

alpha

type I error

beta

type II error

sigma

sample s.d.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided", "greater" (default) or "less".

Value

n number of required samples in each arm of a trial. Note: total number of samples is 2*n.

Examples


getSampleSize(mu0 = 0, mu1 = 200, alpha=0.05, beta=0.2, sigma=450, 
alternative="two.sided")
getSampleSize(mu0 = 8.72, mu1 = 8.72*1.1, alpha=0.05, beta=0.2, sigma=1.3825, 
alternative="greater")
getSampleSize(mu0 = 8.72, mu1 = 8.72*1.1, alpha=0.05, beta=0.2, sigma=1.3825, 
alternative="two.sided")


SPOT documentation built on June 26, 2022, 1:06 a.m.