Skip to contents

This function calculates the prevalence based on a given z-score.

Usage

prevalence(z, method = "proportion", two.tailed = FALSE, dp = 5)

Arguments

z

A numeric value representing the z-score.

method

A character string specifying the method to calculate prevalence. It must be one of "percentage", "proportion", or "ratio" (default: "ratio").

two.tailed

Logical indicating whether to consider both tails of the distribution when calculating prevalence (default: FALSE).

dp

Integer specifying the number of decimal places for the result (default: 5).

Value

The prevalence calculated based on the specified method.

Examples

prevalence(z = -1, method = "proportion", two.tailed = TRUE, dp = 5)
#> [1] 0.31731
prevalence(z = -1, method = "proportion", two.tailed = FALSE, dp = 5)
#> [1] 0.15866