Introduction

This project tells about the relationships between poverty rates and median household income across the U.S. counties. In this dataset it includes county names, states, poverty rates, and median household income.

Research Question

Is there a connection between the percentage of people living in poverty and median household income across U.S. counties?

County Dataset

county <- read.csv("county.csv")

county_project <- county %>% 
select(name, state, poverty, median_hh_income) %>%
filter (!is.na(poverty), !is.na(median_hh_income))

head(county_project)
##             name   state poverty median_hh_income
## 1 Autauga County Alabama    13.7            55317
## 2 Baldwin County Alabama    11.8            52562
## 3 Barbour County Alabama    27.2            33368
## 4    Bibb County Alabama    15.2            43404
## 5  Blount County Alabama    15.6            47412
## 6 Bullock County Alabama    28.5            29655

Dataset Dimensions

dim(county_project)
## [1] 3140    4

Summary Statistics

summary(county_project[, c("poverty", "median_hh_income")])
##     poverty      median_hh_income
##  Min.   : 2.40   Min.   : 19264  
##  1st Qu.:11.30   1st Qu.: 41126  
##  Median :15.20   Median : 48073  
##  Mean   :15.97   Mean   : 49765  
##  3rd Qu.:19.40   3rd Qu.: 55771  
##  Max.   :52.00   Max.   :129588

Average Poverty and Household Income

county_project %>%
summarize(average_poverty = mean(poverty), 
          average_household_income = mean(median_hh_income))
##   average_poverty average_household_income
## 1        15.96885                 49765.39

Scatter Plot

plot(
county_project$poverty, 
county_project$median_hh_income,
main = "Poverty and Household Income Across U.S. Counties",
xlab = "Population Living in Poverty (%)",
ylab = "Median Household Income ($)", 
pch = 19,
col = "steelblue"
) 

correlation <- cor (
    county_project$poverty, 
    county_project$median_hh_income
)
print(correlation)
## [1] -0.7505885

Data Analysis

I used R and the library dplyr package to clean the data, remove missing values, and calculate the summary statistics and find the averages. I also get help to create scatter plot and calculate the correlation between the poverty rates and median household income.

Discussion of Results

This shows a strong negative relationship between poverty rates and median household income, with a correlation of -0.7506.

Conclusion

The results shows that poverty rates and median household income are strongly negatively related across the U.S. counties.

Reference

OpenIntro Data Set (county dataset) https://www.openintro.org/data/index.php?data=county