library(readr)
covid19_2 <- read_csv("PSDA PROJECT2/DATA DOSM/covid19 2.csv")

View(covid19_2)

result<-c(covid19_2$Confirmed)
Ei<-chisq.test(result, correct = FALSE)
Ei$expected
chisq.test(result,correct = FALSE)

curve(dchisq(x, df = 15), from = 0, to = 100,
      main = 'Chi-Square Distribution (df = 15)',
      ylab = 'Density', xlab = 'X2',
      lwd = 1)

x_vector <- seq(15, 150)

p_vector <- dchisq(x_vector, df = 15)

polygon(c(x_vector, rev(x_vector)), c(p_vector, rep(0, length(p_vector))),
        col = adjustcolor('red', alpha=0.3), border = NA)