library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.2.1 ✔ readr 2.2.0
## ✔ forcats 1.0.1 ✔ stringr 1.6.0
## ✔ ggplot2 4.0.3 ✔ tibble 3.3.1
## ✔ lubridate 1.9.5 ✔ tidyr 1.3.2
## ✔ purrr 1.2.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
library(readxl)
data<-read_excel("county.health.rankings.2025.xlsx")
summary(data$`LBW unreliable indicator (Unreliable = Numerator < 20 or relative standard error > 20%)`)
## Length N.unique N.blank Min.nchar Max.nchar
## 3205 3 0 1 9
summary(data$"low birth weight raw value")
## Warning: Unknown or uninitialised column: `low birth weight raw value`.
## Length Class Mode
## 0 NULL NULL
summary(data$'Low Birth Weight raw value')
## Length N.unique N.blank Min.nchar Max.nchar NAs
## 3205 2985 0 3 21 109
hist(as.numeric(data$'Broadband Access raw value'))
## Warning in hist(as.numeric(data$"Broadband Access raw value")): NAs introduced
## by coercion

plot(as.numeric(data$'Broadband Access raw value'),as.numeric(data$'Low Birth Weight raw value'))
## Warning in plot(as.numeric(data$"Broadband Access raw value"),
## as.numeric(data$"Low Birth Weight raw value")): NAs introduced by coercion
## Warning in xy.coords(x, y, xlabel, ylabel, log): NAs introduced by coercion

cor(as.numeric(data$'Broadband Access raw value'),as.numeric(data$'Low Birth Weight raw value'))
## Warning in is.data.frame(y): NAs introduced by coercion
## Warning in is.data.frame(x): NAs introduced by coercion
## [1] NA
cor(as.numeric(data$'Broadband Access raw value'), as.numeric(data$'Low Birth Weight raw value'), use = "complete.obs")
## Warning in is.data.frame(y): NAs introduced by coercion
## Warning in is.data.frame(x): NAs introduced by coercion
## [1] -0.3771428