Overview of Dataset B2
Dataset B2 contains information collected from a group of university students regarding:
Student Type (Domestic or International)
Pet Ownership (Yes or No)
Both variables are categorical. The purpose of the analysis was to determine whether there is an association between student type and pet ownership. The researcher aimed to examine whether being a domestic or international student is related to whether a student owns a pet. Understanding this relationship can help the university and housing providers anticipate student needs, such as pet-friendly housing options.
Because the study involves two categorical variables, the appropriate statistical test is a:
Chi-Square Test of Independence
library(readxl)
library(ggplot2)
library(rcompanion)
DatasetB2 <- read_excel("C:/Users/spvar/Downloads/DatasetB2.xlsx")
table(DatasetB2$StudentType, DatasetB2$PetOwnership)
##
## No Yes
## Domestic 27 25
## International 23 25
ggplot(DatasetB2, aes(x = StudentType, fill = PetOwnership)) +
geom_bar(position = "dodge") +
labs(x = "Student Type", y = "Frequency")
chisq.test(DatasetB2$StudentType, DatasetB2$PetOwnership)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: DatasetB2$StudentType and DatasetB2$PetOwnership
## X-squared = 0.040064, df = 1, p-value = 0.8414
Results
The Chi-Square Test of Independence produced:
χ²(1) = 0.04
p = .841
Because the p-value was greater than .05, the result was not statistically significant. Conclusion
There was no significant association between student type and pet ownership. Domestic and international students reported owning pets at similar rates. Therefore, student type does not appear to influence pet ownership within this sample.