Test the variance with an F Test and normality with a shapiro wilkes test
women_weight = c(38.9, 61.2, 73.3, 21.8, 63.4, 64.6, 48.4, 48.8, 48.5)
men_weight = c(67.8, 60, 63.4, 76, 89.4, 73.3, 67.3, 61.3, 62.4)
# Test the normality - using a shaprio-wilkes test
shapiro.test(men_weight)
##
## Shapiro-Wilk normality test
##
## data: men_weight
## W = 0.86425, p-value = 0.1066
shapiro.test(women_weight)
##
## Shapiro-Wilk normality test
##
## data: women_weight
## W = 0.94266, p-value = 0.6101
The p-values are bigger than .05 meaning we can say our weight ditributions are not significantly different from a normal distribution
Next, lets test the variablity and analyze the f statistics.
var.test(men_weight, women_weight)
##
## F test to compare two variances
##
## data: men_weight and women_weight
## F = 0.36134, num df = 8, denom df = 8, p-value = 0.1714
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
## 0.08150656 1.60191315
## sample estimates:
## ratio of variances
## 0.3613398
The p value is above .05 , meaning there is no significant difference between the variance in the groups
Finally, run a two sample t test
t.test(men_weight, women_weight, var.equal = TRUE)
##
## Two Sample t-test
##
## data: men_weight and women_weight
## t = 2.7842, df = 16, p-value = 0.01327
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 4.029759 29.748019
## sample estimates:
## mean of x mean of y
## 68.98889 52.10000
With the p value above, we can say that there is a significant difference between the two independent samples.