Welch Two Sample t-test
data: legolas and aragorn
t = 6.5541, df = 88.503, p-value = 3.604e-09
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
11.53917 21.58073
sample estimates:
mean of x mean of y
197.4558 180.8958
t.test(legolas, gimli, alternative ="two.sided")
Welch Two Sample t-test
data: legolas and gimli
t = 21.503, df = 97.99, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
57.11855 68.73322
sample estimates:
mean of x mean of y
197.4558 134.5299
Both p-values are below 0.05, therefore we have found a significant difference in height between the actor groups
Re-run the variance test (F-test) to compare the group of Gimli and Legolas actors. Do these groups have different variance?
var.test(gimli, legolas)
F test to compare two variances
data: gimli and legolas
F = 1.0209, num df = 49, denom df = 49, p-value = 0.9426
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.5793374 1.7990213
sample estimates:
ratio of variances
1.020902
The p-value above 0.05 indicates that is no significant difference in variance
Redo the correlation for the Sepal Length and Sepal Width for the Iris dataset, but for the three individual species. Are these correlated?
iris <-read.csv("../data/iris.csv")library(dplyr)
Warning: package 'dplyr' was built under R version 4.4.2
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union