USStates <- read.csv("C:/Users/casey/Downloads/USStates.csv")
df1 <- mutate(USStates, covprev = cases/Pop2019)
model1 <- lm(percent_fully_vax ~ covprev + BidenVote2020 + Region, df1)
summary(model1)
## 
## Call:
## lm(formula = percent_fully_vax ~ covprev + BidenVote2020 + Region, 
##     data = df1)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -6.0124 -2.3351 -0.2495  2.3418  6.5088 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)    35.77747    5.19810   6.883 1.70e-08 ***
## covprev       -56.59033   24.42426  -2.317 0.025222 *  
## BidenVote2020   0.42749    0.07042   6.070 2.66e-07 ***
## RegionNE        4.91261    1.76371   2.785 0.007857 ** 
## RegionS        -5.18318    1.41423  -3.665 0.000662 ***
## RegionW        -1.71578    1.47282  -1.165 0.250311    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.592 on 44 degrees of freedom
## Multiple R-squared:  0.8432, Adjusted R-squared:  0.8254 
## F-statistic: 47.34 on 5 and 44 DF,  p-value: < 2.2e-16
plot(model1, 1:2)