Question: R programming, build your own 1 and 2 sample t test Write your own function my.t.test which can perform both one and two sample t-test.

R programming, build your own 1 and 2 sample t test  R programming, build your own 1 and 2 sample t test

Write your own function my.t.test which can perform both one and two sample t-test. For two sample t-test, it can perform both equal and unequal variance version. Your my.t.test will take the following argument (1) the vector x, (2) optional vector y if it is two sample t-test, (3) type of alternative hypothesis alternative, (4) the mean or mean difference that you are testing mu. Your function my.t.test should contain a routine to check for equal variance assumption using the F test. If the p-value of the F test is 0.05, then it will perform two sample t-test with unequal variance assumption. Your function my.t.test should return the test statistic stat, degrees of freedom df and p-value p.value

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!