sample1 <- c(34, 45, 36, 47, 38)
sample2 <- rep(c(65, 32, 51, 43, 40, 35),
100)
mean(sample1)
[1] 40
sample1
[1] 34 45 36 47 38 34 45 36 47 38 34
[12] 45 36 47 38 34 45 36 47 38 34 45
[23] 36 47 38 34 45 36 47 38 34 45 36
[34] 47 38 34 45 36 47 38 34 45 36 47
[45] 38 34 45 36 47 38 34 45 36 47 38
[56] 34 45 36 47 38 34 45 36 47 38 34
[67] 45 36 47 38 34 45 36 47 38 34 45
[78] 36 47 38 34 45 36 47 38 34 45 36
[89] 47 38 34 45 36 47 38 34 45 36 47
[100] 38 34 45 36 47 38 34 45 36 47 38
[111] 34 45 36 47 38 34 45 36 47 38 34
[122] 45 36 47 38 34 45 36 47 38 34 45
[133] 36 47 38 34 45 36 47 38 34 45 36
[144] 47 38 34 45 36 47 38 34 45 36 47
[155] 38 34 45 36 47 38 34 45 36 47 38
[166] 34 45 36 47 38 34 45 36 47 38 34
[177] 45 36 47 38 34 45 36 47 38 34 45
[188] 36 47 38 34 45 36 47 38 34 45 36
[199] 47 38 34 45 36 47 38 34 45 36 47
[210] 38 34 45 36 47 38 34 45 36 47 38
[221] 34 45 36 47 38 34 45 36 47 38 34
[232] 45 36 47 38 34 45 36 47 38 34 45
[243] 36 47 38 34 45 36 47 38 34 45 36
[254] 47 38 34 45 36 47 38 34 45 36 47
[265] 38 34 45 36 47 38 34 45 36 47 38
[276] 34 45 36 47 38 34 45 36 47 38 34
[287] 45 36 47 38 34 45 36 47 38 34 45
[298] 36 47 38 34 45 36 47 38 34 45 36
[309] 47 38 34 45 36 47 38 34 45 36 47
[320] 38 34 45 36 47 38 34 45 36 47 38
[331] 34 45 36 47 38 34 45 36 47 38 34
[342] 45 36 47 38 34 45 36 47 38 34 45
[353] 36 47 38 34 45 36 47 38 34 45 36
[364] 47 38 34 45 36 47 38 34 45 36 47
[375] 38 34 45 36 47 38 34 45 36 47 38
[386] 34 45 36 47 38 34 45 36 47 38 34
[397] 45 36 47 38 34 45 36 47 38 34 45
[408] 36 47 38 34 45 36 47 38 34 45 36
[419] 47 38 34 45 36 47 38 34 45 36 47
[430] 38 34 45 36 47 38 34 45 36 47 38
[441] 34 45 36 47 38 34 45 36 47 38 34
[452] 45 36 47 38 34 45 36 47 38 34 45
[463] 36 47 38 34 45 36 47 38 34 45 36
[474] 47 38 34 45 36 47 38 34 45 36 47
[485] 38 34 45 36 47 38 34 45 36 47 38
[496] 34 45 36 47 38
mean(sample2)
[1] 44.33333
t.test(sample1, sample2)
Welch Two Sample t-test
data: sample1 and sample2
t = -1.6737, df = 4.2543, p-value
= 0.1652
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-11.355498 2.688832
sample estimates:
mean of x mean of y
40.00000 44.33333
t.test(sample1, sample2, alternative = 'less')
Welch Two Sample t-test
data: sample1 and sample2
t = -1.6737, df = 4.2543, p-value
= 0.08261
alternative hypothesis: true difference in means is less than 0
95 percent confidence interval:
-Inf 1.092793
sample estimates:
mean of x mean of y
40.00000 44.33333
t.test(sample1, sample2, alternative = 'greater')
dat <- read.csv("https://bit.ly/39Fr0gD")
head(dat)
summary(dat)
Question: is it true that time depends on roundness?
round_times <- dat[dat$roundness == 'round','time']
nonround_times <- dat[dat$roundness == 'unrounded','time']
t.test(round_times, nonround_times)
Welch Two Sample t-test
data: round_times and nonround_times
t = -0.9631, df = 589.36, p-value = 0.3359
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-40.69893 13.91676
sample estimates:
mean of x mean of y
295.8432 309.2343
t.test(time ~ roundness, data=dat)
Welch Two Sample t-test
data: time by roundness
t = -0.9631, df = 589.36, p-value = 0.3359
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-40.69893 13.91676
sample estimates:
mean in group round mean in group unrounded
295.8432 309.2343