#install.packages("EnvStats")
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
chi <- read.csv("Frequency_Chi_Square.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