Is there an association between student nationality (domestic versus international) and scholarship status (yes versus no)?
library(readxl)
A4Q2 <- read_excel("C:/Users/nehab/OneDrive/Assignment 4/A4Q2.xlsx")
observed <- table(A4Q2$status, A4Q2$scholarship)
observed
##
## 0 1
## Domestic 39 111
## International 118 32
barplot(observed,
main = "Scholarship Status by Student Nationality",
xlab = "Scholarship Status",
ylab = "Count",
col = rainbow(nrow(observed)),
beside = TRUE,
legend.text = rownames(observed))
chi_result <- chisq.test(observed)
chi_result
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: observed
## X-squared = 81.297, df = 1, p-value < 2.2e-16
v <- sqrt(as.numeric(chi_result$statistic) / sum(observed))
v
## [1] 0.5205671
A Chi-Square Test of Independence showed a statistically significant association between student nationality and scholarship status, X-squared(1, N = 300) = 81.30, p < .001, Cramer’s V = .52. Domestic students were more likely to have a scholarship than international students.