Welch Two Sample t-test
data: legolas and aragorn
t = 5.3392, df = 96.809, p-value = 6.164e-07
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
8.504662 18.568920
sample estimates:
mean of x mean of y
194.0094 180.4726
yes, significant difference, p < 0.001
t.test(legolas, gimli)
Welch Two Sample t-test
data: legolas and gimli
t = 21.869, df = 97.771, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
54.47172 65.34436
sample estimates:
mean of x mean of y
194.0094 134.1014
yes, even more significant, p < 0.001
F-test
var.test(gimli, legolas)
F test to compare two variances
data: gimli and legolas
F = 1.1016, num df = 49, denom df = 49, p-value = 0.7361
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.6251579 1.9413081
sample estimates:
ratio of variances
1.101646
no significant difference in variation, p > 0.05
Correlation Tests
setosa =subset(iris, Species =="setosa")versi =subset(iris, Species =="versicolor")virg =subset(iris, Species =="virginica")cor.test(setosa$Sepal.Length, setosa$Sepal.Width)
Pearson's product-moment correlation
data: setosa$Sepal.Length and setosa$Sepal.Width
t = 7.6807, df = 48, p-value = 6.71e-10
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.5851391 0.8460314
sample estimates:
cor
0.7425467
strong positive correlation, r = 0.74
cor.test(versi$Sepal.Length, versi$Sepal.Width)
Pearson's product-moment correlation
data: versi$Sepal.Length and versi$Sepal.Width
t = 4.2839, df = 48, p-value = 8.772e-05
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.2900175 0.7015599
sample estimates:
cor
0.5259107
moderate positive correlation, r = 0.53
cor.test(virg$Sepal.Length, virg$Sepal.Width)
Pearson's product-moment correlation
data: virg$Sepal.Length and virg$Sepal.Width
t = 3.5619, df = 48, p-value = 0.0008435
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.2049657 0.6525292
sample estimates:
cor
0.4572278