RESEARCH SCENARIO 2

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.

QUESTION What are the null and alternate hypotheses for your research? H0:There is no difference in parents choosing design A and design B H1:There is a difference in parents choosing design A and design B

INSTALL REQUIRED PACKAGE

library(readxl)

IMPORT THE EXCEL FILE INTO R STUDIO

dataset <- read_excel("C:/Users/burug/Downloads/RQ2.xlsx")

CREATE A FREQUENCY TABLE

contingencytable <- table(dataset$Parent, dataset$Preferred_Design)
print(contingencytable)
##         
##           A  B
##   Father 21 29
##   Mother 31 19

CONDUCTING THE TEST

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

INSTALL REQUIRED PACKAGE

library(lsr)

CALCULATE CRAMER’S V

cramers_v <- cramersV(contingencytable)
cat("Cramer's V (effect size):", round(cramers_v, 3), "\n")
## Cramer's V (effect size): 0.18