In: Math
A procurement specialist has purchased 25 resistors from Vendor 1 and 35 resistors from Vendor 2. Each resistor’s resistance was measured and reported in Problem 4 spreadsheet of Homework 2.xlsx. You want to compare mean performance. Use R, and draw conclusions with 0.05 significance. a. First perform the appropriate test to determine whether to assume equal or unequal dispersions of resistance for the two vendors. b. Based on your answer in part a, compare mean performance of the vendors with the appropriate ? test.
Vendor 1 | Vendor 2 |
96.8 | 108.8 |
100 | 106.8 |
100.3 | 102.7 |
98.5 | 104.7 |
98.3 | 110 |
98.2 | 100.2 |
99.6 | 103.2 |
99.4 | 103.7 |
99.9 | 106.8 |
101.1 | 105.1 |
103.7 | 104 |
97.7 | 106.2 |
99.7 | 102.6 |
101.1 | 99.3 |
97.7 | 99 |
98.6 | 108 |
101.9 | 104.3 |
101 | 110.8 |
99.4 | 104 |
99.8 | 106.3 |
99.1 | 102.2 |
99.6 | 102.8 |
101.2 | 104.2 |
98.2 | 103.4 |
98.6 | 104.6 |
102.5 | |
106.3 | |
110.2 | |
107.2 | |
105.4 | |
106.4 | |
106.8 | |
102.1 | |
106.1 | |
110.7 |
Hi.
I am providing the code and the output below. Please ask in the comments if you have any doubts.
We carry out two sample t-test since we have two independent samples and we want to compare means.
## Save the data in a csv file and
then choose the file when dialog box appear
data1<- read.csv(file.choose(), header = T)
## we shall use the two-sample t-test to test the hypothesis:
attach(data1)
t.test(Vendor.1, Vendor.2, conf.level = 0.95, alternative =
"two.sided")
# Welch Two Sample t-test
#
# data: Vendor.1 and Vendor.2
# t = -9.2871, df = 53.288, p-value = 9.939e-13
# alternative hypothesis: true difference in means is not equal
to 0
# 95 percent confidence interval:
# -6.678655 -4.306488
# sample estimates:
# mean of x mean of y
# 99.5760 105.0686
## Since the p-value is very very small for any reasonable value of
level of the test,
#### WE REJECT NULL
HYPOTHESIS THAT THERE'S NO DIFFERENCE IN FAVOR OF ALTERNATIVE THAT
THERE'S SOME DIFFERENCE BETWEEN TWO VENDORS
## We also conduct the sided
test
t.test(Vendor.1, Vendor.2, conf.level = 0.95, alternative =
"less")
# Welch Two Sample t-test
#
# data: Vendor.1 and Vendor.2
# t = -9.2871, df = 53.288, p-value = 4.97e-13
# alternative hypothesis: true difference in means is less than
0
# 95 percent confidence interval:
# -Inf -4.502565
# sample estimates:
# mean of x mean of y
# 99.5760 105.0686
## It again rejected the NULL
####
Interpretation: The mean performance of Vendor 2 is higher than
mean performance of Vendor 1