CochranCont: Cochran's Sample Size for continuous variables

Description Usage Arguments Details Value Author(s) Examples

View source: R/CochranCont.R

Description

Sample size for the mean of a continuous variable, according to Cochran's formula

Usage

1
CochranCont(alfa = 0.05, sigma, E, N = Inf, correct = FALSE)

Arguments

alfa

numeric, alfa error to use

sigma

numeric, standard deviation to use

E

numeric, Measurement Error

N

numeric, Size of the study population

correct

logical, if set to TRUE, it will check if the internally computed sample size is 5 per cent or bigger than the whole population, if this is the case, it will correct the sample size according to the formula n / (1 + n/N)

Details

n <- Zalpha^2 * sigma^2 / E^2

Value

A list containing:

n

numeric value with the sample size estimated for Measurement Error choosen. This value, rounded, is the only printed output

Error

numeric value of Measurement Error as it was set with 'E' argument

alfa

numeric value of alfa error as it was set with 'alfa' argument

sigma

numeric value of standard deviation as it was set with 'sigma' argument

Evect

vector of numeric values, with different alternative values of Measurement Error

nvector

vector of numeric values, with different alternative values of sample size estimated for the Evect values

Author(s)

Miguel Menéndez

Examples

1
size1 <- CochranCont(alfa = 0.05, sigma = 15, E = 2, N = 2000, correct = TRUE)

MiguelMenendezOrenga/usualsupport documentation built on April 11, 2020, 11:43 a.m.