library(readxl) STAT_705_DATA <- read_excel(“C:/Users/nyoun/Downloads/STAT 705 DATA.xlsx”,sheet = “Data”) View(STAT_705_DATA)

#This regression was used in order to determine the effect of median age on death rates. While median age is unlikely to significantly effect number of cases, among those people who are infected, it is generally accepted that the elderly are much more likely to suffer death. AgeDeath = lm(STAT_705_DATA\(`Deaths per Thousand` ~ STAT_705_DATA\)Median age) summary(AgeDeath) confint(AgeDeath)

#This regression was used to determine the effect of per capita GDP on death rates. Richer people tend to have superior health outcomes in every country, because they tend to be physically healthier, as well as more able to take time off from work in the case of illness. In America, this discrepancy is excacerbated by the privatized nature of our healthcare system. GDPDeaths = lm(STAT_705_DATA\(Deaths ~ STAT_705_DATA\)GDP Per Capita (Thousands of Dollars)) summary(GDPDeaths) confint(GDPDeaths)

#This histogram is used as an easy illustration of the difference in death rate between states. In addition, it shows that death rates from COVID-19 are generally lower than most people believe, though this says nothing about rates of lasting complications from contracting the disease. hist(STAT_705_DATA$Deaths per Thousand, main = “Deaths Per Thousand people”, breaks = 50, ylab = “# of states”, xlab = “Death Rate”)

DeathsCapita = c(STAT_705_DATA$Deaths per Thousand)

Age = c(STAT_705_DATA$Median age)

#The next two values are used for a plot comparing population density and cases per capita. Unfortunately, Delaware presented a significant outlier, and so had to be removed from the dataset.

PopDens = c(STAT_705_DATA\(`Population Density (Square mile)`[which(STAT_705_DATA\)Population Density (Square mile)<8000)])

CasesCap = c(STAT_705_DATA\(`Cases Per Capita`[which(STAT_705_DATA\)Population Density (Square mile)<8000)]) ’’ plot(PopDens, CasesCap, xlab = ‘Population Density’, ylab = ‘Cases Per Capita’) abline(DensCasesLM)

#This plot is used to demonstrate the effect of median age on mortality rates. plot(Age, DeathsCapita, ylab = “Deaths per Thousand People”, xlab = “Median Age”) abline(AgeDeath)

#These functions, as well as the related plots, are used to illustrate the effect of median age on disease virality. CasesCap2 = c(STAT_705_DATA$Cases Per Capita) AgeCap2 = lm(CasesCap2~Age) summary(AgeCap2)

plot(Age, CasesCap2, xlab = ‘Median Age’, ylab = ‘Cases Per Capita’) abline(AgeCap2)

#This regression is used to determine the effects of population density on disease spread. It is generally accepted more densely populated areas tend towards faster rates of spread of diseases. It is relevant to know to what degree this is true for America. DensCasesLM = lm(STAT_705_DATA\(`Cases Per Capita`~ STAT_705_DATA\)Population Density (Square mile)) summary(DensCasesLM) confint(DensCasesLM)