. Research on SAS random number generation functions, such as RAND(). Understand how to use it to generate random variables. 2. Use a ‘DO…. END’ loop to create 100 obs, use variable name X. Use an...

. Research on SAS random number generation functions, such as RAND(). Understand how to use it to generate random variables. 2. Use a ‘DO…. END’ loop to create 100 obs, use variable name X. Use an outer DO loop of 500 rounds to generate a total of 500 samples -> you now have 500 samples, each with 100 obs. Then you have the proper dataset to work with. Note, you can refer to a loop as a sample in this case, since it is basically sampling from a standard normal distribution. 3. Calculate the critical values for the z-test and the t-test. 4. Use a PROC MEANS step and a data step to carry out the following hypothesis test for all the samples. You will use a z-test since you know the sample has a standard deviation of 1: H0: µ0=0.3 H1: µ1=0 Let SampMean be your calculated sample mean for each sample. Your z-score will be calculated as Z ¿ Sampmean-H0 1 vN , where N is the sample size. Take 0.05 as the rejection level, then you can reject H0 your when your calculated z score is larger than 1.96 or smaller than -1.96. 5. Count the percent of samples for which you rejected the H0. This percent is your simulated power of z-test when sample size =100 for testing the null hypothesis generate a dataset containing 500 samples, each with 100 obs from the standard normal distribution. execute the hypothesis test, one for each sample compare the powerSTAT671-Spring 2021 H0: µ0=0.3 . Make sure you understand why this simulates the power. Report your result. Part B: Z test when sample size N=500 6. Now, repeat Part A, but this time get 500 obs for each loop. Does your simulated power get higher? Report your result and comment on what you saw. Part C: Test a different null hypothesis this time, with sample size 100 using the dataset you created in Part A. There is no need to create the samples again. H0: µ0=0.5 H1: µ1=0 How does the power of this test compare with what you had in Part A? Report your result and comment on what you saw. Without running more codes, comment on what will happen to the power of the z test if your null hypothesis becomes H0: µ0=0.1.
May 24, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here