powered by
Convert a negative binomial distribution to a normal (gaussian) distribution with specified mu and sd
nbinom2norm(x, mu = 0, sd = 1, size = NULL, prob = NULL)
a vector with a gaussian distribution
the negative binomially distributed vector
the mean of the normal distribution to return
the SD of the normal distribution to return
number of trials (set to max value of x if not specified)
the probability of success on each trial (set to mean probability if not specified)
x <- rnbinom(10000, 20, 0.75) y <- nbinom2norm(x, 0, 1, 20, 0.75) g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) ggExtra::ggMarginal(g, type = "histogram")
Run the code above in your browser using DataLab