Question: Problem Set 1 Use R to answer the questions in this problem set. You will enter your R commands in a script file that you

Problem Set 1

Use R to answer the questions in this problem set. You will enter your R commands in a script file that you will submit when complete. Use comments in your script file to explain your work. You will need to be familiar with the R-functions pnorm, rnorm, qnorm, pbinom, dbinom, pt, sqrt, hist, mean, sd.

For this problem set, you will create a population of 1,000 people that has a normally distributed parameter by copying and pasting the lines of code below into your R script.

# Set seed to get reproducible random numbers

set.seed(1234)

# Consider a population of 1,000

npop = 1000

# Imagine that a measure of a parameter gives

mean = 80

sd = 10

# Create a population with those properties

pop = rnorm(npop,mean,sd)

1. Plot a histogram of our population. Comment on the shape.

2. What is the z score corresponding to the parameter value of 70?

3. What is the probability that someone has a parameter value <= 70?

4. How many people in our population do we expect to have a parameter value <= 70?

5. How many people in our population have a parameter value <= 70?

6. Note that the actual number is less than the expected number, find the probability that exactly 157 people have a parameter score < 70. Assume that the probability of having a score < 70 is 0.159. Hint: to discover the probability of getting n successes in m trials when the probability of success is constant p, use the binomial distribution, dbinom(n,m,p)

7. Find the probability that 157 or fewer people in our population have a parameter value < 70. Assume that the probability of having a score < 70 is 0.159.

8. Comment on the discrepancy between the results for (4) and (5) given the probability calculated in 7.

9. What is the probability of finding fewer than 130 people in our population with a parameter value <= 70? Assume that the probability of having a score < 70 is 0.159.

10. If we indeed found fewer than 130 people with a parameter value < 70, how could we explain that finding?

11. What is the probability of a person in our population having a parameter value > 100?

Use the R-function sample(pop,sample.size) to sample the population pop with a sample size of 5 by copying and pasting the code below to the script file

sample.size=5

set.seed(1234)

my.sample = sample(pop,sample.size)

12. What is the mean and standard deviation of the sample?

13. How do the mean and standard deviation of the sample compare to their expected value?

14. What is the probability of getting a sample mean equal to or less than that obtained?

15. Recalculate this probability assuming you do not know the population standard deviation.

Re-do the analysis with a sample size of 20.

sample.size=20

16. What is the mean and standard deviation of the sample?

17. How do the mean and standard deviation of the sample compare to their expected value?

18. What is the probability of getting a sample mean equal to or less than that obtained?

19. Recalculate this probability assuming you do not know the population standard deviation.

20. How has a larger sample size affected the probabilities?

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!