Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write your own function in R to perform a t-test (it may not use t.test). The t-test should be unpaired and you may assume that

Write your own function in R to perform a t-test (it may not use t.test). The t-test should be unpaired and

you may assume that the samples have equal variance. This function must have the following properties:

a. It should be able to do either a one-sample of two sample t-test and should be able to tell which is required

by whether the user gives one or two samples. hint: You can do this using an if-then structure and the

missing() function.

b. The user should be able to specify a choice of alternative hypotheses by giving arguments two-sided,

less, or greater. If no such alternative is given, then the default should be two-sided.

c. The user should be able to specify a parameter mu indicating the true value of the mean or difference in

means under the null hypothesis. If unspecified, the default should be mu=0.

d. The result should be a list with the value of the t-statistic and the p-value with a names attribute specifying

which is which.

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions