Hazal Gunduz

##Data 606 - Project Proposal

hate_crimes <- ("https://download.data.world/file_download/fivethirtyeight/hate-crimes/hate_crimes.csv")
head(hate_crimes)
## [1] "https://download.data.world/file_download/fivethirtyeight/hate-crimes/hate_crimes.csv"
library(readr)
hate_crimes <- read_csv("hate_crimes.csv")
## Rows: 51 Columns: 12
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (1): state
## dbl (11): median_household_income, share_unemployed_seasonal, share_populati...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(hate_crimes, 51)
## # A tibble: 51 × 12
##    state                median_househol… share_unemploye… share_populatio… share_populatio…
##    <chr>                           <dbl>            <dbl>            <dbl>            <dbl>
##  1 Alabama                         42278            0.06              0.64            0.821
##  2 Alaska                          67629            0.064             0.63            0.914
##  3 Arizona                         49254            0.063             0.9             0.842
##  4 Arkansas                        44922            0.052             0.69            0.824
##  5 California                      60487            0.059             0.97            0.806
##  6 Colorado                        60940            0.04              0.8             0.893
##  7 Connecticut                     70161            0.052             0.94            0.886
##  8 Delaware                        57522            0.049             0.9             0.874
##  9 District of Columbia            68277            0.067             1               0.871
## 10 Florida                         46140            0.052             0.96            0.853
## # … with 41 more rows, and 7 more variables: share_non_citizen <dbl>,
## #   share_white_poverty <dbl>, gini_index <dbl>, share_non_white <dbl>,
## #   share_voters_voted_trump <dbl>, hate_crimes_per_100k_splc <dbl>,
## #   avg_hatecrimes_per_100k_fbi <dbl>

Research question

You should phrase your research question in a way that matches up with the scope of inference your dataset allows for.

=> What is the annual difference in hate crime between white citizens and non-white citizens?

Cases

What are the cases, and how many are there?

nrow(hate_crimes)
## [1] 51

=> There are 51 cases, 50 USA states and the District of Columbia.

Data collection

Describe the method of data collection.

=> The data collection was simple. The data source was posted on FiveThirtyEight’s GitHub in a CSV format. That data was gathered of sources including the Kaiser Family Foundation, Census Bureau, United States Election Project, Souther Poverty Law Center, and the FBI.

Type of study

What type of study is this (observational/experiment)?

=>This is an observational study.

Data Source

If you collected the data, state self-collected. If not, provide a citation/link.

=> https://download.data.world/file_download/fivethirtyeight/hate-crimes/hate_crimes.csv

Response

What is the response variable, and what type is it (numerical/categorical)?

=> The response is annual hate crimes per 100,000 population and it is a numerical variable.

Explanatory

What is the explanatory variable, and what type is it (numerical/categorical)?

=> The explanatory variable is, the population in the state that voted. This is also a numerical variable.

Relevant summary statistics

Provide summary statistics relevant to your research question. For example, if you’re comparing means across groups provide means, SDs, sample sizes of each group. This step requires the use of R, hence a code chunk is provided below. Insert more code chunks as needed.

summary(hate_crimes)
##     state           median_household_income share_unemployed_seasonal
##  Length:51          Min.   :35521           Min.   :0.02800          
##  Class :character   1st Qu.:48657           1st Qu.:0.04200          
##  Mode  :character   Median :54916           Median :0.05100          
##                     Mean   :55224           Mean   :0.04957          
##                     3rd Qu.:60719           3rd Qu.:0.05750          
##                     Max.   :76165           Max.   :0.07300          
##                                                                      
##  share_population_in_metro_areas share_population_with_high_school_degree
##  Min.   :0.3100                  Min.   :0.7990                          
##  1st Qu.:0.6300                  1st Qu.:0.8405                          
##  Median :0.7900                  Median :0.8740                          
##  Mean   :0.7502                  Mean   :0.8691                          
##  3rd Qu.:0.8950                  3rd Qu.:0.8980                          
##  Max.   :1.0000                  Max.   :0.9180                          
##                                                                          
##  share_non_citizen share_white_poverty   gini_index     share_non_white 
##  Min.   :0.01000   Min.   :0.04000     Min.   :0.4190   Min.   :0.0600  
##  1st Qu.:0.03000   1st Qu.:0.07500     1st Qu.:0.4400   1st Qu.:0.1950  
##  Median :0.04500   Median :0.09000     Median :0.4540   Median :0.2800  
##  Mean   :0.05458   Mean   :0.09176     Mean   :0.4538   Mean   :0.3157  
##  3rd Qu.:0.08000   3rd Qu.:0.10000     3rd Qu.:0.4665   3rd Qu.:0.4200  
##  Max.   :0.13000   Max.   :0.17000     Max.   :0.5320   Max.   :0.8100  
##  NA's   :3                                                              
##  share_voters_voted_trump hate_crimes_per_100k_splc avg_hatecrimes_per_100k_fbi
##  Min.   :0.040            Min.   :0.06745           Min.   : 0.2669            
##  1st Qu.:0.415            1st Qu.:0.14271           1st Qu.: 1.2931            
##  Median :0.490            Median :0.22620           Median : 1.9871            
##  Mean   :0.490            Mean   :0.30409           Mean   : 2.3676            
##  3rd Qu.:0.575            3rd Qu.:0.35694           3rd Qu.: 3.1843            
##  Max.   :0.700            Max.   :1.52230           Max.   :10.9535            
##                           NA's   :4                 NA's   :1
library(ggplot2)

Visualizations

ggplot(hate_crimes, aes(x = share_voters_voted_trump, y = avg_hatecrimes_per_100k_fbi)) +
  geom_point(aes(size = avg_hatecrimes_per_100k_fbi), alpha = .6, shape = 16) +
  geom_abline()
## Warning: Removed 1 rows containing missing values (geom_point).

Linear Model

model <- lm(avg_hatecrimes_per_100k_fbi ~ share_voters_voted_trump, data = hate_crimes)
summary(model)
## 
## Call:
## lm(formula = avg_hatecrimes_per_100k_fbi ~ share_voters_voted_trump, 
##     data = hate_crimes)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.1081 -1.1586 -0.0971  0.8863  5.2238 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                6.0260     0.9281   6.493 4.41e-08 ***
## share_voters_voted_trump  -7.4087     1.8300  -4.049 0.000187 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.495 on 48 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.2546, Adjusted R-squared:  0.239 
## F-statistic: 16.39 on 1 and 48 DF,  p-value: 0.0001869

Github => https://github.com/Gunduzhazal/hatecrimes

Rpubs => https://rpubs.com/gunduzhazal/825983