A private all-girls elementary school has developed two different uniform designs: Design A and Design B. They are hoping at least one of the designs will be preferred by both mothers and fathers. Analyze the data to determine if there is a relationship between uniform design and parent.
CHI-SQUARE TEST OF INDEPENDENCE
To test if there is an association between two categorical variables.
There is no association between the two categorical variables.
There is an association between the two categorical variables.
H0: There is no relationship between uniform design and parent H1: There is a relationship between uniform design and parent
Imports your Excel dataset automatically into R Studio. You need to import your dataset every time you want to analyze your data in R Studio.
The package only needs to be installed once. The code for this task is provided below. Remove the hashtag below to convert the note into code.
options(repos = c(CRAN = "https://cloud.r-project.org"))
install.packages("readxl")
## Installing package into 'C:/Users/Murari_Lakshman/AppData/Local/R/win-library/4.5'
## (as 'lib' is unspecified)
## package 'readxl' successfully unpacked and MD5 sums checked
##
## The downloaded binary packages are in
## C:\Users\Murari_Lakshman\AppData\Local\Temp\RtmpSOAfRo\downloaded_packages
You must always reload the package you want to use. The code for this task is provided below. Remove the hashtag below to convert the note into code.
library(readxl)
## Warning: package 'readxl' was built under R version 4.5.2
rq2 <- read_excel("C:/Users/Murari_Lakshman/Downloads/RQ2.xlsx")
Visually display the data. A frequency table can be used instead of a bar graph to visually display the data.
Also called a “contingency table” for Chi-Square Test of Independence.
contingencytable <- table(rq2$Parent, rq2$Preferred_Design)
Determine if the null or alternate hypothesis was supported.
chisq_indep <- chisq.test(contingencytable)
print(chisq_indep)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: contingencytable
## X-squared = 3.2452, df = 1, p-value = 0.07163
If results were statistically significant (p < .05), continue to the effect size section below. If results were NOT statistically significant (p > .05), do NOT calculate the effect size. Instead, skip to the reporting section below. NOTE: Getting results that are not statistically significant does NOT mean you switch to a different test.
Since the p-value is greater than the threshold of 0.05 (p > 0.05), the results are not statistically significant. So skipping effect size.
What were the results? Write them in a paragraph. Put the paragraph in a Word Document.