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

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