Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 9, exercise 4 #6

Open
jcornickm opened this issue Sep 1, 2024 · 0 comments
Open

Chapter 9, exercise 4 #6

jcornickm opened this issue Sep 1, 2024 · 0 comments

Comments

@jcornickm
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant