Assignment 5 Question 2 stated - Is there an association between the student nationality and whether or not they have a scholarship?
load required rcompanion packages
library(readxl)
library(ggpubr)
## Loading required package: ggplot2
library(rcompanion)
library(rmarkdown)
import the A5Q2 dataset
A5Q2 <- read_excel("A5Q2.xlsx")
create the table of data
correction in the removal of the student_id from the table of data
Table <- table(A5Q2$nationality, A5Q2$scholarship_awarded)
Table
##
## 0 1
## Domestic 39 111
## International 118 32
create the barchart of data
barplot(Table, beside = TRUE, col = rainbow(nrow(Table)), legend = rownames(Table), main = "Nationality and Scholarship Awarded", xlab="No or Yes", ylab="Count")
correction of table verse mytable previously in the script
chisq.test(Table)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: Table
## X-squared = 81.297, df = 1, p-value < 2.2e-16
calculate the effect size of the data
rcompanion::cramerV(Table)
## Cramer V
## 0.5272
The interpretation of the data results
A Chi-Square Test of Independence was conducted to determine if there was an association between Variable 1, student nationality and Variable 2, students who got a scholarship. The results showed that there [was] an association between the two variables, χ²(2) = 81.30, p < .001. The association was [strong], (Cramer’s V = .53).
There was a correction in the Chi-Square Test results above, therefore the interpretation has been updated to reflect the current analysis of the dataset.