Question

In: Statistics and Probability

R Simulation: For n = 1000, simulate a random sample of size n from N(0,1). Use...

R Simulation:

For n = 1000, simulate a random sample of size n from N(0,1). Use the generated data to give an approximation to the critical values when α = 0.01,0.05,0.1, and compare them with the theoretical values zα/2. Repeat with n = 10,000 to get a better approximation.

Please use Commands quantile( ) or qnorm( ) or both.

Solutions

Expert Solution

code

x<- rnorm(1000)
z0.01 <- quantile(x,0.995)
z0.05 <- quantile(x,0.975)
z0.1 <- quantile(x,0.95)

c0.01 <- qnorm(0.995)
c0.05 <- qnorm(0.975)
c0.1 <- qnorm(0.95)


z0.01
c0.01

z0.05
c0.05

z0.1
c0.1


y <- rnorm(10000)
z0.01 <- quantile(y,0.995)
z0.05 <- quantile(y,0.975)
z0.1 <- quantile(y,0.95)

c0.01 <- qnorm(0.995)
c0.05 <- qnorm(0.975)
c0.1 <- qnorm(0.95)


z0.01
c0.01

z0.05
c0.05

z0.1
c0.1

#running the code

> x<- rnorm(1000)
> z0.01 <- quantile(x,0.995)
> z0.05 <- quantile(x,0.975)
> z0.1 <- quantile(x,0.95)
> 
> c0.01 <-  qnorm(0.995)
>   c0.05 <- qnorm(0.975)
>   c0.1 <- qnorm(0.95)
>   
>   
> z0.01
   99.5% 
2.614842 
> c0.01
[1] 2.575829
> 
> z0.05
   97.5% 
1.818711 
> c0.05
[1] 1.959964
> 
> z0.1
     95% 
1.567166 
> c0.1
[1] 1.644854
> 
> 
> y <- rnorm(10000)
> z0.01 <- quantile(y,0.995)
> z0.05 <- quantile(y,0.975)
> z0.1 <- quantile(y,0.95)
> 
> c0.01 <-  qnorm(0.995)
> c0.05 <- qnorm(0.975)
> c0.1 <- qnorm(0.95)
> 
> 
> z0.01
   99.5% 
2.561284 
> c0.01
[1] 2.575829
> 
> z0.05
   97.5% 
1.942748 
> c0.05
[1] 1.959964
> 
> z0.1
     95% 
1.649045 
> c0.1
[1] 1.644854

we see that when n = 10000

both are close to each other


Related Solutions

Suppose a simple random sample of size n=1000 is obtained from a population whose size is...
Suppose a simple random sample of size n=1000 is obtained from a population whose size is N=2,000,000 and whose population proportion with a specified characteristic is p = 0.22 a. What is the probability of obtaining x=250 or more individuals with the​ characteristic?
Suppose a simple random sample of size n= 1000 is obtained from a population whose size...
Suppose a simple random sample of size n= 1000 is obtained from a population whose size is N=2,000,000 and whose population proportion with a specified characteristic is p= 0.65. (a) Describe the sampling distribution of (b) What is the probability of obtaining x= 690 or more individuals with the​ characteristic? (c) What is the probability of obtaining x = 620 or fewer individuals with the​ characteristic?
Suppose a simple random sample of size n equals=1000 is obtained from a population whose size...
Suppose a simple random sample of size n equals=1000 is obtained from a population whose size is N equals=1,000,000 and whose population proportion with a specified characteristic is p=0.74. ​(b) What is the probability of obtaining x=770 or more individuals with the​ characteristic? ​(c) What is the probability of obtaining x=720 or fewer individuals with the​ characteristic? ​(Round to four decimal places as​ needed.) How to solve these problems in Statcrunch? Thank you!
A random sample of size n = 100 is taken from a population of size N...
A random sample of size n = 100 is taken from a population of size N = 600 with a population proportion of p =0.46. Is it necessary to apply the finite population correction factor? Calculate the expected value and standard error of the sample proportion. What is the probability that the sample mean is less than .40?
A random sample of size n = 69 is taken from a population of size N...
A random sample of size n = 69 is taken from a population of size N = 971 with a population proportion p = 0.68. a-1. Is it necessary to apply the finite population correction factor? Yes or no? a-2. Calculate the expected value and the standard error of the sample proportion. (Round "expected value" to 2 decimal places and "standard error" to 4 decimal places.) Expected Value- Standard Error- b. What is the probability that the sample proportion is...
A random sample of size n = 71 is taken from a population of size N...
A random sample of size n = 71 is taken from a population of size N = 639 with a population proportion p = 0.73. a-1. Is it necessary to apply the finite population correction factor? a-2. Calculate the expected value and the standard error of the sample proportion. (Round "expected value" to 2 decimal places and "standard error" to 4 decimal places.) b. What is the probability that the sample proportion is less than 0.66? (Round “z” value to...
A random sample of size n = 152 is taken from a population of size N...
A random sample of size n = 152 is taken from a population of size N = 3,300 with mean μ = −71 and variance σ2 = 112. [You may find it useful to reference the z table.] a-1. Is it necessary to apply the finite population correction factor? Yes No a-2. Calculate the expected value and the standard error of the sample mean. (Negative values should be indicated by a minus sign. Round "standard error" to 2 decimal places.)...
A random sample of size n = 472 is taken from a population of size N...
A random sample of size n = 472 is taken from a population of size N = 9,700 with mean μ = −63 and variance σ2 = 176. [You may find it useful to reference the z table.] A-1 Is it necessary to apply the finite population correction factor? Yes No a-2. Calculate the expected value and the standard error of the sample mean. (Negative values should be indicated by a minus sign. Round "standard error" to 2 decimal places.)...
1. (a) Simulate a random sample of size 100 from the exponential distribution with the rate...
1. (a) Simulate a random sample of size 100 from the exponential distribution with the rate parameter λ = 10. Then make a histogram of the simulated data. (b) We use the simulated data as a data set to construct the log-likelihood function as an R function. We will find the MEL of the value λ = 10. Choose the appropriate range for the parameter λ, then make a plot of the log-likelihood function. (c) Use R function ‘optim‘ to...
Simple random sampling uses a sample of size n from a population of size N to...
Simple random sampling uses a sample of size n from a population of size N to obtain data that can be used to make inferences about the characteristics of a population. Suppose that, from a population of 52 bank accounts, we want to take a random sample of four accounts in order to learn about the population. How many different random samples of four accounts are possible?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT