Data from 538 on The Proportion of White Residents Living in Poverty and The Proportion of the Population who Voted for Trump

data538 <- read.csv('https://raw.githubusercontent.com/fivethirtyeight/data/master/hate-crimes/hate_crimes.csv')
data538=data538[c(1,7,10)]
head(data538)
##        state share_white_poverty share_voters_voted_trump
## 1    Alabama                0.12                     0.63
## 2     Alaska                0.06                     0.53
## 3    Arizona                0.09                     0.50
## 4   Arkansas                0.12                     0.60
## 5 California                0.09                     0.33
## 6   Colorado                0.07                     0.44

Plotting the relationship between the share of the 2016 U.S. presidential voters who voted for Donald Trump against the share of white residents who are living in poverty in 2015

plot(data538$share_white_poverty,data538$share_voters_voted_trump, xlab="Share of white residents who are living in poverty",ylab="Share of voters who voted for Trump",main="Relationship B/W Trump Voters and White Residents Living in Poverty")
trumppoverty <- lm(data538$share_voters_voted_trump~data538$share_white_poverty)
abline(trumppoverty)

summary(trumppoverty)
## 
## Call:
## lm(formula = data538$share_voters_voted_trump ~ data538$share_white_poverty)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -0.312542 -0.052037  0.007795  0.061240  0.214686 
## 
## Coefficients:
##                             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   0.2463     0.0543   4.536 3.72e-05 ***
## data538$share_white_poverty   2.6554     0.5718   4.644 2.59e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.09992 on 49 degrees of freedom
## Multiple R-squared:  0.3056, Adjusted R-squared:  0.2915 
## F-statistic: 21.57 on 1 and 49 DF,  p-value: 2.589e-05

The linear regression relationship shows
Trump_Voters = .2463 + 2.6554xShare_of_White_Residents_Living_in_Poverty

The p value is less than 0.05. This suggests that there is a significant relationship between Trump voters and White residents living in poverty.

Residuals Plot

plot(fitted(trumppoverty), resid(trumppoverty))
abline(h=0)

mean(resid(trumppoverty))
## [1] -6.114581e-19

There is no apparent trend in the residuals and the average of the residuals is very close to zero.

Q-Q plot

qqnorm(resid(trumppoverty))
qqline(resid(trumppoverty))

The q-q plot of the residuals shows that the residuals are nearly normal.
Since the p value is low, the residuals are nearly normal, and the average of the residuals is about zero, we can say that there is a linear relationship between the proportion of Trump voters in a state and the proportion of white residents living in poverty and it follows the following trend: Trump_Voters = .2463 + 2.6554xShare_of_White_Residents_Living_in_Poverty