Question: Creating Samples in a Jar using R 4. Create a variable jar that has 50 red and 50 blue marbles (hint: the jar can have

Creating Samples in a Jar using R

4. Create a variable jar that has 50 red and 50 blue marbles (hint: the jar can have strings as objects, with some of the strings being red and some of the strings being blue

5. Confirm there are 50 reds by summing the samples that are red

6. Sample 10 marbles (really strings) from the jar. How many are red? What was the percentage of red marbles?

7. Do the sampling 20 times, using the replicate command. This should generate a list of 20 numbers. Each number is the mean of how many reds there were in 10 samples. Use your printVecInfo to see information of the samples. Also generate a histogram of the samples.

8. Repeat #7 , but this time, sample the jar 100 times. You should get 20 numbers, this time each number represents the mean of how many reds there were in the 100 samples. Use your printVecInfo to see information of the samples. Also generate a histogram of the samples.

9. Repeat #8 , but this time, replicate the sampling 100 times. You should get 100 numbers, this time each number represents the mean of how many reds there were in the 100 samples. Use your printVecInfo to see information of the samples. Also generate a histogram of the samples

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!