library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Workers_Compensation_Claims_Data <- read_csv("Workers__Compensation_Claims_Data.csv")
## Rows: 56 Columns: 18
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (18): Year, Subject employers, Subject employees, Accepted disabling cla...
## 
## ℹ 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.
work_comp2<-Workers_Compensation_Claims_Data
work_comp2 %>% select(`Denied claims`,`Accepted disabling claims`)
## # A tibble: 56 × 2
##    `Denied claims` `Accepted disabling claims`
##              <dbl>                       <dbl>
##  1              NA                       32509
##  2              NA                       35372
##  3            1935                       30338
##  4            1709                       30663
##  5            2177                       34835
##  6            2408                       36802
##  7            2647                       34214
##  8            2699                       32172
##  9            3087                       31013
## 10            4384                       38657
## # ℹ 46 more rows
Workers_Compensation_Claims_Data<-work_comp2

work_comp2<-work_comp2 %>% select(`Denied claims`,`Accepted disabling claims`) %>% na.omit(.)
hist(work_comp2$`Denied claims`)

hist(work_comp2$`Accepted disabling claims`)

summary(work_comp2$`Denied claims`)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    1709    7111   10264   11393   16520   20915
summary(work_comp2$`Accepted disabling claims`)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   18010   22163   28156   29057   34680   47844
summary(work_comp2)
##  Denied claims   Accepted disabling claims
##  Min.   : 1709   Min.   :18010            
##  1st Qu.: 7111   1st Qu.:22163            
##  Median :10264   Median :28156            
##  Mean   :11393   Mean   :29057            
##  3rd Qu.:16520   3rd Qu.:34680            
##  Max.   :20915   Max.   :47844
cor(work_comp2$`Denied claims`,work_comp2$`Accepted disabling claims`)
## [1] -0.2263116
ggplot(work_comp2,aes(x=`Denied claims`,y= `Accepted disabling claims`)) + geom_point()