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.

Inferential test

CHI-SQUARE TEST OF INDEPENDENCE

PURPOSE

To test if there is an association between two categorical variables.

HYPOTHESES

NULL HYPOTHESIS

There is no association between the two categorical variables.

ALTERNATE HYPOTHESIS

There is an association between the two categorical variables.

QUESTION

What are the null and alternate hypotheses for your research?

H0: There is no relationship between uniform design and parent H1: There is a relationship between uniform design and parent

IMPORT EXCEL FILE CODE

PURPOSE OF THIS CODE

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.

INSTALL REQUIRED PACKAGE

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

LOAD THE PACKAGE

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

IMPORT THE EXCEL FILE INTO R STUDIO

rq2 <- read_excel("C:/Users/Murari_Lakshman/Downloads/RQ2.xlsx")

VISUALLY DISPLAY THE DATA

PURPOSE

Visually display the data. A frequency table can be used instead of a bar graph to visually display the data.

CREATE A FREQUENCY TABLE

Also called a “contingency table” for Chi-Square Test of Independence.

contingencytable <- table(rq2$Parent, rq2$Preferred_Design)

CHI-SQUARE TEST OF INDEPENDENCE CODE

PURPOSE

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

DETERMINE STATISTICAL SIGNIFICANCE

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.

Result of statistical significance

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.

RESEARCH REPORT ON RESULTS

QUESTION

What were the results? Write them in a paragraph. Put the paragraph in a Word Document.

  1. Chi-Square Test of Independence
  2. Parent (Mother, Father) and Preferred design (Preferred A, Preferred B)
  3. 100 Parents
  4. Statistically insignificant (p-value > 0.05)
  5. df = 1
  6. X-squared = 3.2452
  7. p-value = 0.07163