Therefore, we can use the classic t-test witch assume equality of the two variances. In conclusion, there is no significant difference between the variances of the two sets of data. It’s greater than the significance level alpha = 0.05. This can be performed with the function var.test() as follow: res.ftest <- var.test(weight ~ group, data = my_data)į = 0.36134, num df = 8, denom df = 8, p-value = 0.1714Īlternative hypothesis: true ratio of variances is not equal to 1 We’ll use F-test to test for homogeneity in variances. Do the two populations have the same variances? Note that, if the data are not normally distributed, it’s recommended to use the non parametric two-samples Wilcoxon rank test.Īssumption 3. In other words, we can assume the normality. With(my_data, shapiro.test(weight)) # p = 0.6įrom the output, the two p-values are greater than the significance level 0.05 implying that the distribution of the data are not significantly different from the normal distribution. # Shapiro-Wilk normality test for Women's weights With(my_data, shapiro.test(weight))# p = 0.1 # Shapiro-Wilk normality test for Men's weights We’ll use the functions with() and shapiro.test() to compute Shapiro-Wilk test for each group of samples. Null hypothesis: the data are normally distributed - Alternative hypothesis: the data are not normally distributed Use Shapiro-Wilk normality test as described at: Normality Test in R. Yes, since the samples from men and women are not related.Īssumtion 2: Are the data from each of the 2 groups follow a normal distribution? Preleminary test to check independent t-test assumptionsĪssumption 1: Are the two samples independents? In other words, we can conclude that the mean values of group A and B are significantly different. If the p-value is inferior or equal to the significance level 0.05, we can reject the null hypothesis and accept the alternative hypothesis. Usually, the results of the classical t-test and the Welch t-test are very similar unless both the group sizes and the standard deviations are very different. Note that, the Welch t-test is considered as the safer one. T = \frac )Ī p-value can be computed for the corresponding absolute value of t-statistic (|t|). If the variance of the two groups are equivalent ( homoscedasticity), the t-test value, comparing the two samples ( \(A\) and \(B\)), can be calculated as follow.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |