Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6. Suppose YN(,0) and Y N(2,0),i=1,...,n. j = 1,...,n, where Y's and Y2's are all independent. Here, the variances and are unknown, but ==.

image text in transcribed

6. Suppose YN(,0) and Y N(2,0),i=1,...,n. j = 1,...,n, where Y's and Y2's are all independent. Here, the variances and are unknown, but ==. We would like to conduct a two-sample t-test to see if = . We would also like to construct a 100(1-a)% confidence interval for 1-2. Define your notations clearly and answer the following questions. (a) State the null and alternative hypotheses. Note that there are three possible alternatives. (b) Let s and be the sample variances. Write the pooled variance estimate for (c) Write the test statistic and its null distribution. (d) For each alternative, write the p-value and explain how to draw a conclusion based on it at the significance level a. 4 (e) Construct a 100(1 - a)% confidence interval for 1-2. You do not need to consider a one-sided confidence bound. (f) Write a function to conduct the tests and construct the interval above. No credit will be given if any built-in function related to the t-test is used. You may use the four Base R. functions for a given distribution (e.g., d/p/q/rt()). Your function should perform as follows. i. The function takes the arguments: y1, y2, alt = "two-sided", lev = 0.95, where the equality indicates the default value. The arguments y1 and y2 are the two samples. The argument alt is the alternative hypothesis whose two other possible values are "less" and "greater". The argument lev is the confidence level 1 -a. ii. The function returns an R list containing the test statistic, p-value, and con- fidence interval. (g) Consider the Cars93 dataset in the MASS package. Use your function above to test if the mean city MPG is different for U.S. cars and non-U.S. cars. Draw a conclusion based on a p-value at the 0.05 significance level. Construct and interpret a 95% confidence interval for the mean city MPG difference.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Differential Equations and Linear Algebra

Authors: Jerry Farlow, James E. Hall, Jean Marie McDill, Beverly H. West

2nd edition

131860615, 978-0131860612

More Books

Students also viewed these Mathematics questions

Question

5. What is the difference between intrinsic and extrinsic rewards?

Answered: 1 week ago

Question

If M = 7, s = 2, and X = 9.5, what is z?

Answered: 1 week ago