library(tidyverse)Jabban_HW_2
Calling the data set
COVID <- read_csv('/Users/eabban/College Stuff/R Studio/biontech_adolescents.csv')Grouping them
COVID_pla <- COVID |>
filter(group == "placebo")
COVID_vac <- COVID |>
filter(group =="vaccine")Counting the number of people and the outcomes
n_pla <- nrow(COVID_pla) #number of people who were given placebo
n_vac <- nrow(COVID_vac) #number of people who were given vaccines
INF_COVID_pla <- sum(COVID_pla$outcome == "COVID-19")
INF_COVID_vac <- sum(COVID_vac$outcome == "COVID-19")Finding the p-value
p0 <- INF_COVID_pla/n_pla
alpha <- 0.05
result <- binom.test(x = INF_COVID_vac, n = n_vac, p = p0, alternative = "less")
result
Exact binomial test
data: INF_COVID_vac and n_vac
number of successes = 0, number of trials = 1131, p-value = 1.276e-08
alternative hypothesis: true probability of success is less than 0.01594331
95 percent confidence interval:
0.000000000 0.002645242
sample estimates:
probability of success
0