Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The following code will randomly generate a vector of 1,000 values, where each generated value has an equal chance of being a 0 or a
The following code will randomly generate a vector of 1,000 values, where each generated value has an equal chance of being a 0 or a 1.
```{r eval=FALSE} rbinom(1000,1,0.5) ```
We will repeat the above line of code 10,000 times using a `for` loop. Each time we run the above line, we will obtain the proportion of zeros generated. We will store the 10,000 proportions of zeros in a vector `x`. Then make a histogram of the `x` vector.
Code should be written using RStudio
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started