# Run this code to load the required packages
suppressMessages(suppressWarnings(suppressPackageStartupMessages({
library(mosaic)
library(supernova)
library(Lock5withR)
})))
CensusSchool <- read.csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vSVaWnM4odSxy0mlnhWvvGbeLtiKoZmsbqC6KLzXtBOjQfrF9EVKuX4RVh3XbP3iw/pub?gid=2100178416&single=true&output=csv", header = TRUE)
#str(CensusSchool)
#gf_jitter(Score_in_memory_game~DataYear, data=CensusSchool, alpha = .2)
CensusSchool$CovidYears <- ifelse(CensusSchool$DataYear>2019, c("Covid"), c("PreCovid"))
#head(select(CensusSchool, CovidYears))
MemYr <- select(CensusSchool, Score_in_memory_game,CovidYears)
MemYr <- filter(CensusSchool, Score_in_memory_game > 0, Score_in_memory_game < 120, DataYear > 2017)
gf_jitter(Score_in_memory_game~CovidYears, data=MemYr, alpha = .2)
lm(Score_in_memory_game~CovidYears, data=MemYr) -> Covid.model
lm(Score_in_memory_game~NULL, data= MemYr)-> empty.model
Covid.model
empty.model
predict(empty.model) -> MemYr$empty_pred
predict(Covid.model) -> MemYr$covid_pred
gf_jitter(Score_in_memory_game ~ CovidYears, data = MemYr, width = .2, size = 2) %>% gf_jitter(empty_pred~., height=0, color="blue") %>% gf_jitter(covid_pred~., height=0, color="orange")
supernova(Covid.model)
samplef <- fVal(Score_in_memory_game ~ CovidYears, data = MemYr)
SDof <- do(1000) *fVal(Score_in_memory_game~shuffle(CovidYears), data = MemYr)
gf_histogram(~fVal, data = SDof) %>% gf_point(0~samplef)
supernova(Covid.model)
confint(Covid.model)