Rows: 52 Columns: 3
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (2): Location, Maternal Mortality Rate per 100,000 live Births
dbl (1): Number of Deaths
ℹ 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.
maternalmortality2018$NAME <- maternalmortality2018$Locationmaternalmortality2018$`Maternal Mortality Rate per 100,000 live Births`<-as.numeric(maternalmortality2018$`Maternal Mortality Rate per 100,000 live Births`)
y$WithinCoPctFemale <- y$WithinCoFE/y$TotFemaleE*100y$DiffStatePctFemale <- y$DiffStateFE/y$TotFemaleE*100y$DiffCoSameStatePctFemale <- y$DiffCoSameStateFE/y$TotFemaleE*100y$SameHouseFemalePct <- y$SameHouseFemaleE/y$TotFemaleE*100joined <-left_join(y, maternalmortality2018, by ="NAME")cor.test(joined$`Maternal Mortality Rate per 100,000 live Births`, joined$DiffCoSameStatePctFemale, method ="spearman")
Warning in cor.test.default(joined$`Maternal Mortality Rate per 100,000 live
Births`, : Cannot compute exact p-value with ties
Spearman's rank correlation rho
data: joined$`Maternal Mortality Rate per 100,000 live Births` and joined$DiffCoSameStatePctFemale
S = 3214.7, p-value = 0.1271
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
0.2848242
plot(joined$SameHouseFemalePct, joined$`Maternal Mortality Rate per 100,000 live Births`)text(joined$NAME)
Warning in xy.coords(x, y, recycle = TRUE, setLab = FALSE): NAs introduced by
coercion
joined$state <- joined$NAMEvars <-c("SameHouseFemalePct", "DiffCoSameStatePctFemale", "DiffStatePctFemale")#Mobility Measures lapply(vars, function(x) {plot_usmap(regions ="states", values = x, data = joined)+scale_fill_continuous(low ="white", high ="steel blue", name = x, label = scales::comma )+ggtitle(x)+theme(legend.position ="right")})
[[1]]
[[2]]
[[3]]
#Maternal Mortalityplot_usmap(regions ="states", values ="Maternal Mortality Rate per 100,000 live Births", data = joined)+scale_fill_continuous(low ="white", high ="red", label = scales::comma)+ggtitle("")+theme(legend.position ="right")
NVSS
#read.table("C:/Users/jacob/University of Texas at San Antonio/TEAM - Cossman Crew - General/F-31/Inputs/Nat2021us")
ACS/IPUMS
#if (!require("ipumsr")) stop("Reading IPUMS data into R requires the ipumsr package. It can be installed using the following command: install.packages('ipumsr')")#ddi <- read_ipums_ddi("usa_00008.xml")#data <- read_ipums_micro(ddi)