#install.packages("EnvStats")
#install.packages("readxl")
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.2     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.2     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.1     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(infer)
library(EnvStats)
## 
## Attaching package: 'EnvStats'
## 
## The following objects are masked from 'package:stats':
## 
##     predict, predict.lm
## 
## The following object is masked from 'package:base':
## 
##     print.default
library(readxl)
chi <- read.csv("Frequency_Chi_Square.csv")
chi4 <-  read.csv("Frequency_Chi_Square_4.csv")
chisq.test(chi$Reading, chi$English, correct = FALSE)
## 
##  Pearson's Chi-squared test
## 
## data:  chi$Reading and chi$English
## X-squared = 11.96, df = 12, p-value = 0.4489
#chisq.test(chi$Reading)
x <- c(10.4, 8.6, 8.0, 3.4, 3);
chisq.test(x)
## 
##  Chi-squared test for given probabilities
## 
## data:  x
## X-squared = 6.5222, df = 4, p-value = 0.1634
chin <- read.csv("Frequency_Chi_Square_Numeric.csv")
chisq.test(chin$C3)
## Warning in chisq.test(chin$C3): Chi-squared approximation may be incorrect
## 
##  Chi-squared test for given probabilities
## 
## data:  chin$C3
## X-squared = 133.2, df = 259, p-value = 1
chisq.test (chin$Reading, chin$C3)
## 
##  Pearson's Chi-squared test
## 
## data:  chin$Reading and chin$C3
## X-squared = 780, df = 9, p-value < 2.2e-16
chisq.test (chin$Reading,chin$English)
## 
##  Pearson's Chi-squared test
## 
## data:  chin$Reading and chin$English
## X-squared = 11.96, df = 12, p-value = 0.4489
chisq.test (chin$English, chin$C3)
## 
##  Pearson's Chi-squared test
## 
## data:  chin$English and chin$C3
## X-squared = 11.96, df = 12, p-value = 0.4489
chisq.test(chi4$Reading,chi4$English)
## 
##  Pearson's Chi-squared test
## 
## data:  chi4$Reading and chi4$English
## X-squared = 11.96, df = 12, p-value = 0.4489
chisq.test(chi4$C3, chi4$C4)
## 
##  Pearson's Chi-squared test
## 
## data:  chi4$C3 and chi4$C4
## X-squared = 11.631, df = 9, p-value = 0.2349
chisq.test(chi4$Reading,chi4$C3)
## 
##  Pearson's Chi-squared test
## 
## data:  chi4$Reading and chi4$C3
## X-squared = 780, df = 9, p-value < 2.2e-16
##tabulate(chi4$English, chi4$C4)
table (chi4$English)
## 
##     A  B  C  D 
## 40 49 53 56 62
table(chi4$English, chi4$C4)
##    
##      1  2  3  4
##      0  0  0  0
##   A 49  0  0  0
##   B  0 53  0  0
##   C  0  0 56  0
##   D  0  0  0 62
table(chi4$Reading, chi4$C3)
##    
##      1  2  3  4
##   A 66  0  0  0
##   B  0 66  0  0
##   C  0  0 60  0
##   D  0  0  0 68
chi4xl <- read_excel("Frequency_Chi_Square_4.XLSX")
table(chi4xl$Reading, chi4xl$C3)
##    
##      1  2  3  4
##   A 66  0  0  0
##   B  0 66  0  0
##   C  0  0 60  0
##   D  0  0  0 68