Lab 2C
Directions: Follow along with the slides and answer the questions in red font in your journal.
39/100
, or 39%
.R
.rap
songs, we’ll use the repeat (rep
) function.R
, c()
.songs
into the console and hit enter to see your individual songs."rap"
songs you drew from the 10.
R
to do()
multiple repetitions for us.
do
the sample
code from the previous slide 50 times run:draws
. Then fill in the blank below to tally how often each genre was selected:"rap"
songs for your 50 draws and find out if the range for your class’ proportions is bigger or smaller than when we drew 10 songs."rap"
.When using simulations to estimate probabilities, using a large number of repeats is better because the estimates have less variability and so we can be confident we’re closer to the actual value.
set.seed()
.## [1] "rap"
set.seed
then redo the simulation of 50 songs.
set.seed(___)
just before simulating the 50 draws.set.seed(___)
should be the same number for both partners."rap"
songs.set.seed(___)
.
set.seed
that give different answers?If we select a student at random, what is the probability that this student is one of the one’s who went to the movies last Friday?
set.seed(123)
in your code before you do
500 repeated samples.