library(readxl)
library(rcompanion)
library(ggplot2)
A4Q2 <- read_excel("C:/Users/Ckbar/OneDrive - Saint Louis University/AA 5221/Assignment 4/A4Q2.xlsx")
schol_table <- table(A4Q2$status, A4Q2$scholarship)
schol_table
##
## 0 1
## Domestic 39 111
## International 118 32
barplot(schol_table)

beside = TRUE
col = rainbow(nrow(schol_table))
legend = rownames(schol_table)
chi_result <- chisq.test(schol_table)
chi_result
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: schol_table
## X-squared = 81.297, df = 1, p-value < 2.2e-16
install.packages("rcompanion")
## Warning: package 'rcompanion' is in use and will not be installed
rcompanion::cramerV(schol_table)
## Cramer V
## 0.5272
# A Chi-Square Test of Independence was conducted to determine if there was an association between status (Domestic or International) and scholarship (0 or 1).
# 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).