rbinorm: Bimodal Normal Distribution

Description Usage Arguments Details Value Author(s) Examples

View source: R/rbinorm.R

Description

Simulates random data from a bimodal Gaussian distribution.

Usage

1
rbinorm(n, mean1, mean2, sd1, sd2, prop)

Arguments

n

Number of observations to simulate

mean1

Mean of mode 1

mean2

Mean of mode 2

sd1

Standard deviation of mode 1

sd2

Standard deviation of mode 2

prop

Probability of being in mode 1. 1 - prop is the probability of being in mode 2.

Details

This function is modeled off of the rnorm function.

Value

Generates random deviates

Author(s)

Michelle Saul

Examples

1
2
3
4
5
## Generate 100 samples from a two component Guassian curve
samples <- rbinorm(n=100, mean1=10, mean2=20, sd1=1, sd2=2, prop=.5)

## Plot distribution of simulated data
plot(density(samples))

FamilyRank documentation built on Feb. 5, 2021, 9:05 a.m.