t2norm | R Documentation |
These functions check whether a normal approximation is appropriate for a given distribution.
They return TRUE
if the approximation condition is met, and FALSE
otherwise.
The threshold parameter c
can be set directly or retrieved via getOption()
.
The functions apply the following rules:
t2norm
: n > c
with default c = 30
.
binom2norm
:
If type = "single"
(default), the approximation is valid if size × prob × (1 - prob) > c
.
If type = "double"
, the approximation requires both size × prob > c
and size × (1 - prob) > c
, with default c = 9
.
clt2norm
: n > c
with default c = 30
. Note that the existence of expectation and variance, required by the Central Limit Theorem, cannot be checked automatically.
t2norm(n, c = getOption("distribution.t2norm", 30))
binom2norm(
size,
prob,
c = getOption("distribution.binom2norm", 9),
type = c("single", "double")
)
clt2norm(n, c = getOption("distribution.clt2norm", 30))
approx_binom2norm(
size,
prob,
c = getOption("distribution.binom2norm", 9),
type = c("single", "double")
)
approx_clt2norm(n, c = getOption("distribution.clt2norm", 30))
approx_t2norm(n, c = getOption("distribution.t2norm", 30))
n |
integer: number of observations (for |
c |
numeric: threshold parameter for approximation (default via |
size |
integer: number of trials (for |
prob |
numeric: probability of success on each trial (for |
type |
character: approximation type, |
logical: TRUE
if the approximation is valid, FALSE
otherwise
# Check for 5 and 50 observations
t2norm(n = c(5, 50))
binom2norm(size = c(5, 50), prob = 0.5)
binom2norm(size = c(5, 50), prob = 0.5, type = "double")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.