Below uses the data set on Crashes in Austin. Link to more informaiton and data dictionary: https://data.austintexas.gov/Transportation-and-Mobility/Austin-Crash-Report-Data-Crash-Victim-Demographic-/xecs-rpy9/about_data
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.2 ✔ tibble 3.3.0
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.1
## ✔ purrr 1.1.0
## ── 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
library(readxl)
setwd("C:/Users/KaeRo/Desktop/R Studio/Reseach Data Selection")
library(readr)
Austin_Crash_Report_Data_Crash_Victim_Demographic_Records_20250916 <- read_csv("Austin_Crash_Report_Data_-_Crash_Victim_Demographic_Records_20250916.csv")
## Rows: 9004 Columns: 17
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (5): mode_desc, Crash Time Stamp (US/Central), Crash timestamp, Person e...
## dbl (9): ID, prsn_injry_sev_id, prsn_age, prsn_ethnicity_id, mode_id, Crash ...
## lgl (3): Is deleted, Is primary person, Is temporary record
##
## ℹ 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.
summary(Austin_Crash_Report_Data_Crash_Victim_Demographic_Records_20250916$prsn_age)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 0.00 25.00 34.00 37.06 48.00 119.00 227
hist(Austin_Crash_Report_Data_Crash_Victim_Demographic_Records_20250916$prsn_ethnicity_id)
plot(Austin_Crash_Report_Data_Crash_Victim_Demographic_Records_20250916$prsn_age,Austin_Crash_Report_Data_Crash_Victim_Demographic_Records_20250916$prsn_ethnicity_id)
cor(Austin_Crash_Report_Data_Crash_Victim_Demographic_Records_20250916$prsn_age,Austin_Crash_Report_Data_Crash_Victim_Demographic_Records_20250916$prsn_injry_sev_id)
## [1] NA