binom2norm: Convert binomial to normal

Description Usage Arguments Value Examples

View source: R/distribution_convertors.R

Description

Convert a binomial distribution to a normal (gaussian) distribution with specified mu and sd

Usage

1
binom2norm(x, mu = 0, sd = 1, size = NULL, prob = NULL)

Arguments

x

the binomially distributed vector

mu

the mean of the normal distribution to return

sd

the SD of the normal distribution to return

size

number of trials (set to max value of x if not specified)

prob

the probability of success on each trial (set to mean probability if not specified)

Value

a vector with a gaussian distribution

Examples

1
2
3
4
x <- rbinom(10000, 20, 0.75)
y <- binom2norm(x, 0, 1, 20, 0.75)
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.