Question: (1) (15 Points) (Stata / R problem.) Suppose that you know that X ~ U( - 116+ ), but is not known. In this problem,
(1) (15 Points) (Stata / R problem.) Suppose that you know that X ~ U( - 116+ ), but is not known. In this problem, we will perform a hypothesis test on the population mean, 4. In class we derived a test statistic that comes from an asymptotic approximation, 3/ N(0,1), which can be used for hypothesis testing for large samples and is valid regardless of the underlying distribution of 2;. In this problem, we will see how close the results from this large sample hypothesis test are to results from a hypothesis test using a simulated distribution for our estimator, which uses the knowledge that I; comes from a uniform distribution. (a) Set the random number seed to 417, and generate 10 draws from the distribution with H= 2. Estimate fi using the sample mean, i.e. j =i. Hint: to draw from a uniform RV with y = 2 over the sample space |--3,7), you can use the code: gen xeruniform()-3 (b) Would you be able to reject the null hypothesis that y=0? Let's first test this hy- pothesis using a simulated distribution for . To do this, run a simulation where you draw 10 times from a uniform distribution with h = 0. Calculate #Then repeat this 500 times, obtaining , where i = 1, ..., 500. Plot a histogram of all i. Find the 95th percentile of these estimates. Is je from part (a) above this level? At what significance level does ja from part (a) reject the null hypothesis that d = 0 (i.e., what is the p-value of the hypothesis test)? (Hint: there are different ways to do this problem in Stata / R. One way is to write a loop. Another way is to draw 5000 observations from the uniform distribution, and use the first 10 obs to calculate in the second 10 to calculate fe, etc.) (e) How often would you be able to reject Hok=0 with ten draws if x = 2? To figure this out, simulate a new set of 500 iterations of ten draws using ji = 2. Plot the histogram, and calculate the proportion falling above the 95th percentile from part (b). This proportion is called the power of a hypothesis test, and is defined as 1 - Pr{Type II error| H, is true}. We want this number to be big, because we want to reject the null with a high probability if the null is not true. (1) (15 Points) (Stata / R problem.) Suppose that you know that X ~ U( - 116+ ), but is not known. In this problem, we will perform a hypothesis test on the population mean, 4. In class we derived a test statistic that comes from an asymptotic approximation, 3/ N(0,1), which can be used for hypothesis testing for large samples and is valid regardless of the underlying distribution of 2;. In this problem, we will see how close the results from this large sample hypothesis test are to results from a hypothesis test using a simulated distribution for our estimator, which uses the knowledge that I; comes from a uniform distribution. (a) Set the random number seed to 417, and generate 10 draws from the distribution with H= 2. Estimate fi using the sample mean, i.e. j =i. Hint: to draw from a uniform RV with y = 2 over the sample space |--3,7), you can use the code: gen xeruniform()-3 (b) Would you be able to reject the null hypothesis that y=0? Let's first test this hy- pothesis using a simulated distribution for . To do this, run a simulation where you draw 10 times from a uniform distribution with h = 0. Calculate #Then repeat this 500 times, obtaining , where i = 1, ..., 500. Plot a histogram of all i. Find the 95th percentile of these estimates. Is je from part (a) above this level? At what significance level does ja from part (a) reject the null hypothesis that d = 0 (i.e., what is the p-value of the hypothesis test)? (Hint: there are different ways to do this problem in Stata / R. One way is to write a loop. Another way is to draw 5000 observations from the uniform distribution, and use the first 10 obs to calculate in the second 10 to calculate fe, etc.) (e) How often would you be able to reject Hok=0 with ten draws if x = 2? To figure this out, simulate a new set of 500 iterations of ten draws using ji = 2. Plot the histogram, and calculate the proportion falling above the 95th percentile from part (b). This proportion is called the power of a hypothesis test, and is defined as 1 - Pr{Type II error| H, is true}. We want this number to be big, because we want to reject the null with a high probability if the null is not true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
