Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

rcode please 3. (20 ) Let X be a random variable with mean . When X has normal distribution or the sample size is sufficiently

rcode please

image text in transcribed
3. (20 ) Let X be a random variable with mean . When X has normal distribution or the sample size is sufficiently large, the t-test is used to test the hypotheses Ho: p= HO VS Ha : > Po for some hypothesised value po. The t-test is implemented in R using the t. test command. If neither X is normally distributed nor the sample size is sufficiently large, a nonparametric alternative to the t-test is the Wilcoxon test which is implemented in R using the command wilcox. test. Conduct a small Monte Carlo study to compare the performance of the two tests when X has (i) normal distribution N(#, 1) and (ii) double exponential distribution (location = p and rate = 1). You can sample from the double exponential distribution using the command rdexp from the nimble package. For each distribution, use three sample sizes n = 15, 25, 50. Use o = 0.05 for both tests, and set /o = 0. a. For each sample size and each distribution, compute the observed significance level of the t-test and the wilcoxon test by sampling from each distribution under the null hypothesis Ho. Use m = 10, 000 Monte Carlo samples. b. For each sample size and each distribution, compute the power of the t-test and the wilcoxon test by sampling from each distribution under the alternative hypothesis H. with #1 = seq (0, 1, 0.05). Use m = 10, 000 Monte Carlo samples. For each sample size and distribution, plot the power curves for the two tests in the same plot using different colors for the curves

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Practice Of Statistics

Authors: Daren S. Starnes, Josh Tabor

6th Edition

978-1319113339

Students also viewed these Mathematics questions