#CORRECTION: INSERT QUESTION AND HEADING: Is there an association between student nationality (domestic versus international) and whether or note they have a scholarship (yes vs no)?
library(readxl)
library(ggplot2)
library(rcompanion)
nationality <- read_excel("nationality.xlsx")
MyTable <- table(nationality$nationality, nationality$scholarship_awarded)
MyTable
##
## 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")
#CORRECTION: INSERT X AXIS AND TITLE #COREECTION: ERROR IN BARPLOT labeling of “TABLE”, MUST REFER TO MYTABLE
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
rcompanion::cramerV(MyTable)
## Cramer V
## 0.5272
A Chi-Square Test of Independence was conducted to determine if there was an association between nationality (domestic versus international) and whether the student recieved a scholarship (yes or no).
The results showed that there was an association between , χ²(1) = 81.30, p < .001
The association was strong, (Cramer’s V = .53).
#CORRECTION - CRAMERS INCORRECTLY ROUNDED to .52, MODIFIED TO .53 #CORRECTION - MODIFIED TO MAKE SUMMARY MORE CLEAR