Eamonn Mallon
20/09/2020
mod_diamond2 <- lm(lprice ~ lcarat + color + cut + clarity, data = diamonds2)
library(SMPracticals)#Data is in this package
t.test(formula = height ~ type, # Formula
data = darwin) # Dataframe containing the variables
Welch Two Sample t-test
data: height by type
t = 2.4371, df = 22.164, p-value = 0.02328
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.3909566 4.8423767
sample estimates:
mean in group Cross mean in group Self
20.19167 17.57500
Outcrossed plants (mean +/- 95% confidence intervals: 20.19(0.39)) are larger than selfed plants (17.58 (4.48)) (t-test: t = 2.4371, df =22.164, p = 0.02328)
wilcox.test(formula = len ~ supp, # Formula
data = ToothGrowth, exact=FALSE) # Dataframe containing the variables
Wilcoxon rank sum test with continuity correction
data: len by supp
W = 575.5, p-value = 0.06449
alternative hypothesis: true location shift is not equal to 0
There is no significant difference between supplement types on their effect on tooth growth (Wilcoxon Rank-Sum Test: W= 575.5, n = 60, p = 0.06449)