library(readxl)
library(rcompanion)
library(ggplot2)
A4Q2 <- read_excel("//apporto.com/dfs/SLU/Users/sararaewomack_slu/Desktop/Assignment 4/A4Q2.xlsx")
international_student <- table(A4Q2$status, A4Q2$scholarship)
international_student
##
## 0 1
## Domestic 39 111
## International 118 32
barplot(international_student,
beside = TRUE,
col = rainbow(nrow(international_student)),
legend = rownames(international_student))

chi_result <- chisq.test(international_student)
chi_result
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: international_student
## X-squared = 81.297, df = 1, p-value < 2.2e-16
rcompanion::cramerV(international_student)
## Cramer V
## 0.5272
# A Chi-Square Test of Independence was conducted to determine if there was an association between status and scholarship.
# The results showed that there was an association between the two variables, χ²(1) = 81.30, p < .001.
# The association was large, (Cramer's V = .53).