nPowerSample: Calculates the sample size for hypotesis tests

Description Usage Arguments Value Examples

View source: R/nPowerSample.R

Description

This function calculates de sample size for hypotesys tests considering the following hypotesis:

H_{0}:\text{ } μ \neq μ_{0}

H_{0}:\text{ } \bar{p} \neq p_{0}

H_{0}:\text{ } μ ≤q \text{ or } ≥q μ_{0}

H_{0}:\text{ } \bar{p} ≤q \text{ or } ≥q p_{0}

Usage

1
2
nPowerSample(p = NULL, p0 = NULL, mu = NULL, mu0 = NULL,
  sd = NULL, alpha = 0.05, beta = 0.2, alternative = 1)

Arguments

p

Population proportion.

p0

Hypothesized proportion.

mu

Population mean.

mu0

Hypothesized mean.

alpha

Level of significance.

alternative

1 if is a greater/lesser test and 2 for equal/different one.

Value

The sample size.

Examples

1
2
3
4
nPowerSample(p=0.03, p0=0.05)
nPowerSample(p=0.02, p0=0.05)
nPowerSample(mu=100, mu0=120,sd=24)
nPowerSample(mu=100, mu0=110,sd=24,beta=0.05,alternative = 2)

cgu-dados/auditsampling documentation built on March 24, 2021, 9:38 a.m.