n_ztest: Sample Size Calculation for the two-sided z-Test

Description Usage Arguments Details Value Examples

View source: R/n_ztest.R

Description

n_ztest performs the Sample Size calculation for the z-Test to the level α comparing two independent samples. The method is based on the pages 13 - 16 in [1].

Null Hypothesis:

μ_Y - μ_X = 0

Alternative Hypothesis:

μ_Y - μ_X ≥ Δ_A

Usage

1
n_ztest(effect, sd, alpha, power, r)

Arguments

effect

Effect Δ_A used as alternative hypothesis.

sd

Standard deviation σ.

alpha

Significance level α.

power

Desired Power 1-β.

r

Quotient of Group sizes r = n_Y / n_X.

Details

[1] M.Kieser: Fallzahlberechnung in der medizinischen Forschung [2018], 1th Edition

Value

n_ztest returns an object of type list. The resulting Sample Sizes are located in entrys named n_X, n_Y, n. The resulting power is named power_out

Examples

1
2
3
n_ztest(effect = .5, sd = 1, alpha = .05, power = .90, r = 2)
n_ztest(effect = .5, sd = 1, alpha = .05, power = .90, r = 2)$n
n_ztest(effect = .5, sd = 1, alpha = .05, power = .90, r = 2)$power_out

goseberg/samplesizr documentation built on May 28, 2019, 8:43 a.m.