Open jcornickm opened 3 weeks ago
We are asked to generate a sample of size N from an urn with 52% blue beads. The code provided is as follows:
N <- 1000 p <- 0.52 x <- rbinom(N, 1, 0.5)
This is drawing a sample from a population with 50% blue beads. The correct code would be either
x <- rbinom(N,1,p)
or
x <-rbinom(N,1,0.52)
Am I mistaken?
We are asked to generate a sample of size N from an urn with 52% blue beads. The code provided is as follows:
This is drawing a sample from a population with 50% blue beads. The correct code would be either
or
x <-rbinom(N,1,0.52)
Am I mistaken?