Learn R Programming

PASWR2 (version 1.0.5)

bino.gen: Binomial Distribution Simulation

Description

Function that generates and displays m repeated samples of n Bernoulli trials with a given probability of success

Usage

bino.gen(samples = 10000, n = 20, pi = 0.5)

Arguments

samples

number of repeated samples to generate

n

number of Bernoulli trials

pi

probability of success for each Bernoulli trial

Value

simulated.distribution

Simulated binomial distribution

theoretical.distribution

Theoretical binomial distribution

Examples

Run this code
# NOT RUN {
bino.gen(samples=50000, n = 10, pi = 0.80)

# }

Run the code above in your browser using DataLab