library(readxl)
library(ggplot2)
library(rcompanion)
ds2 <- read_excel("~/Downloads/ds2.xlsx")
MyTable <- table(ds2$nationality, ds2$scholarship_awarded)
barplot(MyTable, beside = TRUE,
col = rainbow(nrow(MyTable)),
legend = rownames(MyTable))
chisq.test(MyTable)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: MyTable
## X-squared = 81.297, df = 1, p-value < 2.2e-16
rcompanion::cramerV(MyTable)
## Cramer V
## 0.5272
A Chi-Square Test of Independence was conducted to determine if there was an association between student nationality and scholarship awarded. The results showed that there was an association between the two variables, χ²(1) = 81.30, p < .001. The association was strong, (Cramer’s V = .53).