title: “Corrected A5Q2 rmd File” author: “Alea Salgado” date: “2026-07-27” output: html_document

library(readxl)
library(ggplot2)
library(rcompanion)
A5Q2 <- read_excel("C:/Users/aleat/Downloads/A5Q2.xlsx")
MyTable <- table(A5Q2$nationality, A5Q2$scholarship_awarded)

Table 0 1 Domestic 39 111 International 118 32

barplot(MyTable, beside = TRUE, col = rainbow(nrow(MyTable)), legend = rownames(MyTable), main = "Nationality and Scholarship Awarded", xlab="No or Yes", ylab="Count")

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

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

Cramer V = 0.5272 A Chi-Square Test of Independence was conducted to determine if there was an association between student nationality (domestic v international) and if the student recieved a scholarship. The results showed that there was an association between the two variables, χ² = 81.30, p < .001. The association was strong, (Cramer’s V = .53).