Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Provide statistical solution step by step and Rcode 2. Suppose Yu ~ N(p1, of) and Vaj ~ N(#2, ;),i - 1, ..., m,j - 1,...,

Provide statistical solution step by step and Rcode

image text in transcribed
2. Suppose Yu ~ N(p1, of) and Vaj ~ N(#2, ;),i - 1, ..., m,j - 1,..., n2, where Yu's and Yay's are all independent. In Homework 6, we wrote a function to test Ho : /1 - /42 and construct a 100(1 -a)% confidence interval for # - pg assuming the variances of and of were unknown but equal. In this problem, we modify the function to incorporate the case where the variances are unknown and unequal. Define your notation clearly and answer the following questions. For parts (a) and (b), assume of and of are unknown and unequal. (a) Write the test statistic and its null distribution. Specify the null distribution degrees of freedom using the Satterthwaite approximation discussed in class. (b) Construct a 100(1 - a)% confidence interval for # - #2. You do not need to consider a one-sided confidence bound. (c) Modify the two-sample t-test function you wrote in Homework 6 so that the function works whether or not the unknown variances are equal. 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: yl, 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 - o. ii. The function first conducts a variance test using the function you wrote in Problem 1. If the variance test p-value is greater than 0.05, the function assumes of - o?; otherwise, it assumes of / o?. Based on that assumption, the function tests Ho : #1 - #2 and constructs a 100(1 - a)% confidence interval for /4 - /2- ili. The function returns an R list containing the test name, test statistic, p-value, and confidence interval, where the test name takes one of the following two values A. "two-sample t-test with unknown but equal variances"; B. "two-sample t-test with unknown and unequal variances". iv. The function does not return the variance test result. (d) Use your new f-test function above to repeat part (g) of Problem 6 in Homework 6. Are the results same as before? Why or why not

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_2

Step: 3

blur-text-image_3

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

An Introduction to the Mathematics of financial Derivatives

Authors: Salih N. Neftci

2nd Edition

978-0125153928, 9780080478647, 125153929, 978-0123846822

More Books

Students also viewed these Mathematics questions

Question

Human brain is also known as the emotional brain?

Answered: 1 week ago

Question

This is the outer most carnival appendage?

Answered: 1 week ago

Question

Proximity of the brain tissue?

Answered: 1 week ago

Question

Human brain are.......?

Answered: 1 week ago

Question

How many lobes are in the cerebral cortex?

Answered: 1 week ago