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

View(covid19_2)

sum_of_X=sum(covid19_2$Confirmed)
sum_of_Y=sum(covid19_2$Deaths)
sum_of_X2=sum( covid19_2$Confirmed ^2 )
sum_of_Y2=sum( covid19_2$Deaths ^2 )
sum_of_XY=sum( (covid19_2$Confirmed) *(covid19_2$Deaths) )

plot(covid19_2$Confirmed, covid19_2$Deaths, main = "scatterplot of confirmed cases and deaths",
     xlab = "Confirmed cases", ylab = "Deaths",pch=20)

cor(covid19_2$Confirmed, covid19_2$Deaths, method = "pearson")

abline(lm(covid19_2$Deaths ~ covid19_2$Confirmed, data = covid19_2), col="red")
