one_norm_size {rashnu}R Documentation

Sample Size or Power Calculation for One-Sample Normal Mean Test

Description

Calculates sample size or power for a two-sample normal mean test.

Usage

one_norm_size(mu, mu0, sd, alpha, beta = NULL, n = NULL)

Arguments

mu

Numeric. True mean.

mu0

Numeric. Null hypothesis mean.

sd

Numeric. Standard deviation.

alpha

Numeric. Type I error rate.

beta

Numeric (optional). Type II error rate. Required for sample size calculation.

n

Integer (optional). Sample size. Required for power calculation.

Value

Numeric. Returns sample size (if beta is given), or power (if n is given).

Note

Only one of beta (for sample size calculation) or n (for power calculation) should be specified.

Required arguments:

Examples

# Sample size
one_norm_size(mu = 2, mu0 = 1.5, sd = 1,
              alpha = 0.05, beta = 0.2)

# Power
one_norm_size(mu = 2, mu0 = 1.5, sd = 1,
              alpha = 0.05, n = 32)


[Package rashnu version 0.1.2 Index]