norm2binom: Convert normal to binomial

Description Usage Arguments Value Examples

View source: R/distribution_convertors.R

Description

Convert normal to binomial

Usage

1
norm2binom(x, size = 1, prob = 0.5, mu = mean(x), sd = stats::sd(x))

Arguments

x

the normally distributed vector

size

number of trials (0 or more)

prob

the probability of success on each trial (0 to 1)

mu

the mean of x (calculated from x if not given)

sd

the SD of x (calculated from x if not given)

Value

a vector with a binomial distribution

Examples

1
2
3
4
x <- rnorm(10000)
y <- norm2binom(x)
g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y))
ggExtra::ggMarginal(g, type = "histogram")

faux documentation built on Sept. 14, 2021, 1:08 a.m.