Question: Solve with given information >xBar=955 #sample mean >mu0=1000 #hypothesized value >sigma=220 #population standard deviation, sqrt(102) >n=50 #sample size >z= (xbar-mu0)/(sigma/sqrt(n)) >z #test statistic [1] 1.446

Solve with given information

>xBar=955 #sample mean

>mu0=1000 #hypothesized value

>sigma=220 #population standard deviation, sqrt(102)

>n=50 #sample size

>z= (xbar-mu0)/(sigma/sqrt(n))

>z #test statistic

[1] 1.446

>alpha=.025

>zalpha=qnorm(1-alpha)

>zalpha #critical value

[1] 1.96

>pval=pnorm(z)

>pval #lower tail p-value

[1] 0.148

  1. Here we will consider how the p-value will change with the sample size, keeping all of the other information the same. Create a vector, called n, of different sample sizes, from 10 to 200 at an increment of 5. You can do this using the seq() command. Use this vector of sample sizes, along with the information in question 1 and the pnorm() function, to create a vector of p-values that is the same length as the vector n. Plot the vector of sample sizes on the horizontal axis and the vector of p-values on the vertical axis using the plot function. Label the axes.
    1. Paste the figure below. What happens to the p-value as the sample size increases?
    2. What range of sample sizes will give you a statistically significant result, holding the population standard deviation and sample average constant?

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!