DRAFT utility to use formulas provided as text, to calculate indicators
Source:R/utils_calc_ejam.R
calc_ejam.Rd
DRAFT utility to use formulas provided as text, to calculate indicators
Usage
calc_ejam(bg, keep.old = c("bgid", "pop"), keep.new = "all", formulas)
Examples
### example using just 10 block groups from 1 county in Delaware
c1 <- fips2countyname(fips_counties_from_state_abbrev('DE'), includestate = F)[1]
bgdf = data.frame(EJAM::blockgroupstats[ST == "DE" & countyname == c1, ])[1:10, ]
newdf <- calc_ejam(bgdf, keep.old = "",
formulas = c(
"my_custom_recalc_demog <- (pctlowinc + pctmin)/2",
"mystat2 = 100 * pctlowinc"))
#> Using my_custom_recalc_demog <- (pctlowinc + pctmin)/2
#> Using mystat2 = 100 * pctlowinc
cbind(Demog.Index = bgdf$Demog.Index, newdf, pctlowinc = bgdf$pctlowinc)
#> Demog.Index my_custom_recalc_demog mystat2 pctlowinc
#> 1 0.9766157 0.2323699 31.618497 0.31618497
#> 2 1.0680585 0.2669546 29.200864 0.29200864
#> 3 0.6710971 0.1662854 18.956337 0.18956337
#> 4 0.4376062 0.1271490 4.512894 0.04512894
#> 5 1.0170804 0.2709582 20.786312 0.20786312
#> 6 1.2143828 0.3244353 24.435318 0.24435318
#> 7 0.9690528 0.2968687 3.576642 0.03576642
#> 8 1.0601834 0.2846830 20.727273 0.20727273
#> 9 1.7480996 0.4780220 30.563187 0.30563187
#> 10 1.5937522 0.4312377 29.783890 0.29783890
newdf <- calc_ejam(bgdf, formulas = formulas_d)
#> Using Demog.Index <- ifelse(pop == 0, 0, as.numeric(Demog.Index) / pop)
#> Using Demog.Index.State <- ifelse(pop == 0, 0, as.numeric(Demog.Index.State) / pop)
#> Using Demog.Index.Supp <- ifelse(pop == 0, 0, as.numeric(Demog.Index.Supp) / pop)
#> Using Demog.Index.Supp.State <- ifelse(pop == 0, 0, as.numeric(Demog.Index.Supp.State) / pop)
#> Using dpm <- ifelse(pop == 0, 0, as.numeric(dpm) / pop)
#> Using drinking <- ifelse(pop == 0, 0, as.numeric(drinking) / pop)
#> Cannot use formula: EJ.DISPARITY.dpm.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.dpm.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.dpm.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.dpm.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.drinking.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.drinking.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.drinking.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.drinking.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.no2.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.no2.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.no2.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.no2.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.o3.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.o3.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.o3.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.o3.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.pctpre1960.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pre1960.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.pctpre1960.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pre1960.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.pm.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pm.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.pm.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pm.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npdes.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npdes.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npdes.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npdes.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npl.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npl.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npl.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npl.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.rmp.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.rmp.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.rmp.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.rmp.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.tsdf.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.tsdf.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.tsdf.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.tsdf.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.rsei.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.rsei.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.rsei.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.rsei.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.traffic.score.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.traffic.score.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.traffic.score.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.traffic.score.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.ust.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.ust.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.ust.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.ust.supp) / pop)
#> Using lifexyears <- ifelse(pop == 0, 0, as.numeric(lifexyears) / pop)
#> Using lowlifex <- ifelse(pop == 0, 0, as.numeric(lowlifex) / pop)
#> Cannot use formula: lowlifex_synonym <- ifelse(pop == 0, 0, as.numeric(lowlifex_synonym) / pop)
#> Using no2 <- ifelse(pop == 0, 0, as.numeric(no2) / pop)
#> Using o3 <- ifelse(pop == 0, 0, as.numeric(o3) / pop)
#> Cannot use formula: p_chinese <- ifelse(lan_universe == 0, 0, as.numeric(p_chinese) / lan_universe)
#> Cannot use formula: p_korean <- ifelse(lan_universe == 0, 0, as.numeric(p_korean) / lan_universe)
#> Using pctaa <- ifelse(pop == 0, 0, as.numeric(aa) / pop)
#> Using pctaiana <- ifelse(pop == 0, 0, as.numeric(aiana) / pop)
#> Using pctapi_li <- ifelse(lingiso == 0, 0, as.numeric(api_li) / lingiso)
#> Using pctba <- ifelse(pop == 0, 0, as.numeric(ba) / pop)
#> Using pctdisability <- ifelse(disab_universe == 0, 0, as.numeric(disability) / disab_universe)
#> Using pctfemale <- ifelse(pop == 0, 0, as.numeric(female) / pop)
#> Cannot use formula: pctfire <- ifelse(pop == 0, 0, as.numeric(fire) / pop)
#> Cannot use formula: pctfire30 <- ifelse(pop == 0, 0, as.numeric(fire30) / pop)
#> Cannot use formula: pctflood <- ifelse(pop == 0, 0, as.numeric(flood) / pop)
#> Cannot use formula: pctflood30 <- ifelse(pop == 0, 0, as.numeric(flood30) / pop)
#> Using pcthisp <- ifelse(pop == 0, 0, as.numeric(hisp) / pop)
#> Using pctie_li <- ifelse(lingiso == 0, 0, as.numeric(ie_li) / lingiso)
#> Using pctlan_api <- ifelse(lan_universe == 0, 0, as.numeric(lan_api) / lan_universe)
#> Cannot use formula: pctlan_arabic <- ifelse(lan_universe == 0, 0, as.numeric(lan_arabic) / lan_universe)
#> Cannot use formula: pctlan_english <- ifelse(lan_universe == 0, 0, as.numeric(lan_english) / lan_universe)
#> Cannot use formula: pctlan_french <- ifelse(lan_universe == 0, 0, as.numeric(lan_french) / lan_universe)
#> Using pctlan_ie <- ifelse(lan_universe == 0, 0, as.numeric(lan_ie) / lan_universe)
#> Cannot use formula: pctlan_non_english <- ifelse(lan_universe == 0, 0, as.numeric(lan_non_english) / lan_universe)
#> Using pctlan_nonenglish <- ifelse(lan_universe == 0, 0, as.numeric(lan_nonenglish) / lan_universe)
#> Using pctlan_other <- ifelse(lan_universe == 0, 0, as.numeric(lan_other) / lan_universe)
#> Cannot use formula: pctlan_other_asian <- ifelse(lan_universe == 0, 0, as.numeric(lan_other_asian) / lan_universe)
#> Cannot use formula: pctlan_other_ie <- ifelse(lan_universe == 0, 0, as.numeric(lan_other_ie) / lan_universe)
#> Cannot use formula: pctlan_rus_pol_slav <- ifelse(lan_universe == 0, 0, as.numeric(lan_rus_pol_slav) / lan_universe)
#> Using pctlan_spanish <- ifelse(lan_universe == 0, 0, as.numeric(lan_spanish) / lan_universe)
#> Cannot use formula: pctlan_vietnamese <- ifelse(lan_universe == 0, 0, as.numeric(lan_vietnamese) / lan_universe)
#> Using pctlingiso <- ifelse(hhlds == 0, 0, as.numeric(lingiso) / hhlds)
#> Using pctlowinc <- ifelse(povknownratio == 0, 0, as.numeric(lowinc) / povknownratio)
#> Using pctlths <- ifelse(age25up == 0, 0, as.numeric(lths) / age25up)
#> Using pctmale <- ifelse(pop == 0, 0, as.numeric(male) / pop)
#> Cannot use formula: pctmin <- ifelse(pop == 0, 0, as.numeric(min) / pop)
#> Using pctmulti <- ifelse(pop == 0, 0, as.numeric(multi) / pop)
#> Using pctnhaa <- ifelse(pop == 0, 0, as.numeric(nhaa) / pop)
#> Using pctnhaiana <- ifelse(pop == 0, 0, as.numeric(nhaiana) / pop)
#> Using pctnhba <- ifelse(pop == 0, 0, as.numeric(nhba) / pop)
#> Using pctnhmulti <- ifelse(pop == 0, 0, as.numeric(nhmulti) / pop)
#> Using pctnhnhpia <- ifelse(pop == 0, 0, as.numeric(nhnhpia) / pop)
#> Using pctnhotheralone <- ifelse(pop == 0, 0, as.numeric(nhotheralone) / pop)
#> Using pctnhpia <- ifelse(pop == 0, 0, as.numeric(nhpia) / pop)
#> Using pctnhwa <- ifelse(pop == 0, 0, as.numeric(nhwa) / pop)
#> Using pctother_li <- ifelse(lingiso == 0, 0, as.numeric(other_li) / lingiso)
#> Using pctotheralone <- ifelse(pop == 0, 0, as.numeric(otheralone) / pop)
#> Using pctover17 <- ifelse(pop == 0, 0, as.numeric(over17) / pop)
#> Using pctover64 <- ifelse(pop == 0, 0, as.numeric(over64) / pop)
#> Using pctownedunits <- ifelse(occupiedunits == 0, 0, as.numeric(ownedunits) / occupiedunits)
#> Cannot use formula: pctownedunits_dupe <- ifelse(builtunits == 0, 0, as.numeric(ownedunits_dupe) / builtunits)
#> Using pctpoor <- ifelse(hhlds == 0, 0, as.numeric(poor) / hhlds)
#> Using pctpre1960 <- ifelse(builtunits == 0, 0, as.numeric(pre1960) / builtunits)
#> Using pctspanish_li <- ifelse(lingiso == 0, 0, as.numeric(spanish_li) / lingiso)
#> Using pctunder18 <- ifelse(pop == 0, 0, as.numeric(under18) / pop)
#> Using pctunder5 <- ifelse(pop == 0, 0, as.numeric(under5) / pop)
#> Using pctunemployed <- ifelse(unemployedbase == 0, 0, as.numeric(unemployed) / unemployedbase)
#> Using pctwa <- ifelse(pop == 0, 0, as.numeric(wa) / pop)
#> Using percapincome <- ifelse(pop == 0, 0, as.numeric(percapincome) / pop)
#> Using pm <- ifelse(pop == 0, 0, as.numeric(pm) / pop)
#> Using proximity.npdes <- ifelse(pop == 0, 0, as.numeric(proximity.npdes) / pop)
#> Using proximity.npl <- ifelse(pop == 0, 0, as.numeric(proximity.npl) / pop)
#> Using proximity.rmp <- ifelse(pop == 0, 0, as.numeric(proximity.rmp) / pop)
#> Using proximity.tsdf <- ifelse(pop == 0, 0, as.numeric(proximity.tsdf) / pop)
#> Cannot use formula: rateasthma <- ifelse(pop == 0, 0, as.numeric(rateasthma) / pop)
#> Cannot use formula: ratecancer <- ifelse(pop == 0, 0, as.numeric(ratecancer) / pop)
#> Cannot use formula: rateheartdisease <- ifelse(pop == 0, 0, as.numeric(rateheartdisease) / pop)
#> Using rsei <- ifelse(pop == 0, 0, as.numeric(rsei) / pop)
#> Cannot use formula: sitecount_avg <- ifelse(pop == 0, 0, as.numeric(sitecount_avg) / pop)
#> Cannot use formula: state.EJ.DISPARITY.dpm.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.dpm.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.dpm.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.dpm.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.drinking.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.drinking.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.drinking.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.drinking.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.no2.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.no2.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.no2.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.no2.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.o3.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.o3.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.o3.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.o3.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pctpre1960.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pre1960.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pctpre1960.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pre1960.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pm.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pm.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pm.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pm.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npdes.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npdes.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npdes.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npdes.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npl.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npl.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npl.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npl.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.rmp.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.rmp.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.rmp.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.rmp.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.tsdf.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.tsdf.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.tsdf.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.tsdf.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.rsei.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.rsei.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.rsei.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.rsei.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.traffic.score.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.traffic.score.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.traffic.score.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.traffic.score.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.ust.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.ust.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.ust.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.ust.supp) / pop)
#> Using traffic.score <- ifelse(pop == 0, 0, as.numeric(traffic.score) / pop)
#> Using ust <- ifelse(pop == 0, 0, as.numeric(ust) / pop)
newdf
#> bgid pop Demog.Index Demog.Index.State Demog.Index.Supp
#> 1 43898 1730 0.9766157 1.1314893 1.660339
#> 2 43899 2315 1.0680585 1.2387696 1.603119
#> 3 43900 1902 0.6710971 0.7782094 1.349002
#> 4 43901 1396 0.4376062 0.5094014 1.195211
#> 5 43902 2778 1.0170804 1.1813878 1.374649
#> 6 43903 974 1.2143828 1.4106592 1.283345
#> 7 43904 1380 0.9690528 1.1296332 1.178557
#> 8 43905 1414 1.0601834 1.2316876 1.461414
#> 9 43906 1456 1.7480996 2.0317845 1.674221
#> 10 43907 2545 1.5937522 1.8519125 1.551187
#> Demog.Index.Supp.State dpm drinking lifexyears lowlifex no2
#> 1 1.6873961 0.08376106 0 0.0 NA 3.733971
#> 2 1.5106840 0.08158785 0 0.0 NA 3.427091
#> 3 1.1773713 0.08322352 0 0.0 NA 4.019559
#> 4 1.0002807 0.08719409 0 0.0 NA 4.302965
#> 5 1.1484063 0.10165017 0 78.4 0.1958974 6.132311
#> 6 1.0372039 0.16091800 0 78.4 0.1958974 7.375660
#> 7 0.9201528 0.16092262 0 78.4 0.1958974 7.053986
#> 8 1.2577259 0.10043416 0 76.0 0.2205128 4.884089
#> 9 1.5091678 0.12157435 0 76.0 0.2205128 6.694556
#> 10 1.3617250 0.14939342 0 76.0 0.2205128 6.686144
#> o3 pctaa pctaiana pctapi_li pctba pctdisability
#> 1 60.50869 0.020231214 0.000000000 0 0.008092486 0.1414953
#> 2 60.50869 0.000000000 0.001727862 0 0.120518359 0.1414953
#> 3 60.50869 0.015772871 0.000000000 0 0.024710831 0.1414953
#> 4 60.50869 0.030085960 0.000000000 0 0.127507163 0.1414953
#> 5 60.46486 0.019438445 0.000000000 0 0.212742981 0.1297128
#> 6 60.46486 0.010266940 0.000000000 0 0.325462012 0.1297128
#> 7 60.46486 0.002173913 0.004347826 0 0.438405797 0.1297128
#> 8 60.64451 0.000000000 0.000000000 0 0.292786421 0.1320406
#> 9 60.64451 0.055631868 0.000000000 0 0.394230769 0.1320406
#> 10 60.64451 0.000000000 0.000000000 0 0.447937132 0.1320406
#> pctfemale pcthisp pctie_li pctlan_api pctlan_ie pctlan_nonenglish
#> 1 0.4658960 0.091907514 0 0.044020648 0.011327789 0.11786636
#> 2 0.4341253 0.120086393 1 0.044020648 0.011327789 0.11786636
#> 3 0.4605678 0.000000000 0 0.044020648 0.011327789 0.11786636
#> 4 0.4971347 0.051575931 0 0.044020648 0.011327789 0.11786636
#> 5 0.4474442 0.066954644 0 0.010201913 0.002125399 0.03273114
#> 6 0.3901437 0.009240246 0 0.010201913 0.002125399 0.03273114
#> 7 0.5210145 0.000000000 0 0.010201913 0.002125399 0.03273114
#> 8 0.4427157 0.045261669 0 0.004085603 0.068677043 0.13346304
#> 9 0.5027473 0.192307692 0 0.004085603 0.068677043 0.13346304
#> 10 0.5151277 0.098624754 0 0.004085603 0.068677043 0.13346304
#> pctlan_other pctlan_spanish pctlingiso pctlowinc pctlths pctmale
#> 1 0.000000000 0.06251792 0.06197655 0.31618497 0.09117647 0.5341040
#> 2 0.000000000 0.06251792 0.01454545 0.29200864 0.12894144 0.5658747
#> 3 0.000000000 0.06251792 0.00000000 0.18956337 0.08196721 0.5394322
#> 4 0.000000000 0.06251792 0.00000000 0.04512894 0.08918618 0.5028653
#> 5 0.001062699 0.01934113 0.00000000 0.20786312 0.07335907 0.5525558
#> 6 0.001062699 0.01934113 0.00000000 0.24435318 0.00000000 0.6098563
#> 7 0.001062699 0.01934113 0.00000000 0.03576642 0.05303030 0.4789855
#> 8 0.000000000 0.06070039 0.00000000 0.20727273 0.04831461 0.5572843
#> 9 0.000000000 0.06070039 0.00000000 0.30563187 0.11881188 0.4972527
#> 10 0.000000000 0.06070039 0.00000000 0.29783890 0.05116796 0.4848723
#> pctmin pctmulti pctnhaa pctnhaiana pctnhba pctnhmulti
#> 1 0.1485549 0.077456647 0.020231214 0.000000000 0.008092486 0.022543353
#> 2 0.2419006 0.118358531 0.000000000 0.001727862 0.114902808 0.003887689
#> 3 0.1430074 0.102523659 0.015772871 0.000000000 0.024710831 0.102523659
#> 4 0.2091691 0.002148997 0.030085960 0.000000000 0.127507163 0.000000000
#> 5 0.3340533 0.044636429 0.019438445 0.000000000 0.212383009 0.021958243
#> 6 0.4045175 0.068788501 0.010266940 0.000000000 0.325462012 0.059548255
#> 7 0.5579710 0.113043478 0.002173913 0.004347826 0.438405797 0.113043478
#> 8 0.3620934 0.024045262 0.000000000 0.000000000 0.292786421 0.024045262
#> 9 0.6504121 0.152472527 0.021978022 0.000000000 0.394230769 0.041895604
#> 10 0.5646365 0.082514735 0.000000000 0.000000000 0.447937132 0.018074656
#> pctnhnhpia pctnhotheralone pctnhpia pctnhwa pctother_li pctotheralone
#> 1 0 0.005780347 0 0.8514451 0 0.042774566
#> 2 0 0.001295896 0 0.7580994 0 0.001295896
#> 3 0 0.000000000 0 0.8569926 0 0.000000000
#> 4 0 0.000000000 0 0.7908309 0 0.029369628
#> 5 0 0.013318934 0 0.6659467 0 0.030597552
#> 6 0 0.000000000 0 0.5954825 0 0.000000000
#> 7 0 0.000000000 0 0.4420290 0 0.000000000
#> 8 0 0.000000000 0 0.6379066 0 0.000000000
#> 9 0 0.000000000 0 0.3495879 0 0.017170330
#> 10 0 0.000000000 0 0.4353635 0 0.012966601
#> pctover17 pctover64 pctownedunits pctpoor pctpre1960 pctspanish_li
#> 1 0.6427746 0.12774566 0.9380235 0.08877722 0.07336523 1
#> 2 0.7870410 0.14773218 0.7127273 0.09212121 0.10626186 0
#> 3 0.7676130 0.15089380 0.9053254 0.07248521 0.01775148 0
#> 4 0.6898281 0.14111748 0.9611872 0.03196347 0.00000000 0
#> 5 0.7062635 0.12634989 0.8008089 0.08190091 0.23710317 0
#> 6 0.6509240 0.08418891 0.4255319 0.02127660 0.62610619 0
#> 7 0.7942029 0.09710145 0.6360485 0.02599653 0.05693431 0
#> 8 0.6852900 0.13012730 0.9092527 0.06405694 0.09074733 0
#> 9 0.7637363 0.33379121 1.0000000 0.06363636 0.00000000 0
#> 10 0.7831041 0.22003929 0.5537270 0.26137464 0.16034483 0
#> pctunder18 pctunder5 pctunemployed pctwa percapincome pm
#> 1 0.3572254 0.01387283 0.05135521 0.8514451 25866 6.072637
#> 2 0.2129590 0.06349892 0.03463588 0.7580994 33823 6.072637
#> 3 0.2323870 0.05257624 0.04851485 0.8569926 38368 6.072637
#> 4 0.3101719 0.07020057 0.14285714 0.8108883 41652 6.072637
#> 5 0.2937365 0.05363571 0.07427056 0.6925846 37468 6.227564
#> 6 0.3490760 0.09650924 0.02974828 0.5954825 29040 6.227564
#> 7 0.2057971 0.13333333 0.09481808 0.4420290 41437 6.227564
#> 8 0.3147100 0.03748232 0.00000000 0.6831683 34314 6.448012
#> 9 0.2362637 0.05494505 0.02678571 0.3804945 32752 6.448012
#> 10 0.2168959 0.05579568 0.02945990 0.4565815 31230 6.448012
#> proximity.npdes proximity.npl proximity.rmp proximity.tsdf rsei
#> 1 0.00 0.00000000 0.11961676 0.07673559 30.29144
#> 2 0.00 0.08090212 0.09494493 0.09570535 32.28447
#> 3 0.00 0.00000000 0.18218209 0.00000000 286.25193
#> 4 0.00 0.00000000 0.25081388 0.00000000 94.35266
#> 5 0.00 0.00000000 1.21004338 0.00000000 645.08162
#> 6 0.00 0.00000000 0.35736429 0.00000000 593.23796
#> 7 0.00 0.00000000 0.43124858 0.00000000 626.38669
#> 8 15656.03 0.06606892 0.17603964 0.07189385 659.38569
#> 9 0.00 0.00000000 0.15356840 0.09791155 271.25415
#> 10 0.00 0.00000000 0.24891049 0.00000000 542.73884
#> traffic.score ust
#> 1 99577.78 0.00000000
#> 2 121645.30 0.02051317
#> 3 52506.01 0.00000000
#> 4 93204.63 0.00000000
#> 5 154729.67 0.00000000
#> 6 408625.06 3.55401687
#> 7 310667.15 2.32778139
#> 8 371829.17 0.09460093
#> 9 393595.36 0.00000000
#> 10 520089.35 3.12424712
## example of entire US
#
newdf1 <- calc_ejam(as.data.frame(bgdf), formulas = formulas_d)
#> Using Demog.Index <- ifelse(pop == 0, 0, as.numeric(Demog.Index) / pop)
#> Using Demog.Index.State <- ifelse(pop == 0, 0, as.numeric(Demog.Index.State) / pop)
#> Using Demog.Index.Supp <- ifelse(pop == 0, 0, as.numeric(Demog.Index.Supp) / pop)
#> Using Demog.Index.Supp.State <- ifelse(pop == 0, 0, as.numeric(Demog.Index.Supp.State) / pop)
#> Using dpm <- ifelse(pop == 0, 0, as.numeric(dpm) / pop)
#> Using drinking <- ifelse(pop == 0, 0, as.numeric(drinking) / pop)
#> Cannot use formula: EJ.DISPARITY.dpm.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.dpm.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.dpm.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.dpm.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.drinking.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.drinking.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.drinking.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.drinking.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.no2.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.no2.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.no2.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.no2.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.o3.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.o3.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.o3.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.o3.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.pctpre1960.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pre1960.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.pctpre1960.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pre1960.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.pm.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pm.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.pm.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pm.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npdes.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npdes.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npdes.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npdes.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npl.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npl.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npl.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npl.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.rmp.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.rmp.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.rmp.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.rmp.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.tsdf.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.tsdf.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.tsdf.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.tsdf.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.rsei.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.rsei.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.rsei.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.rsei.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.traffic.score.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.traffic.score.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.traffic.score.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.traffic.score.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.ust.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.ust.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.ust.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.ust.supp) / pop)
#> Using lifexyears <- ifelse(pop == 0, 0, as.numeric(lifexyears) / pop)
#> Using lowlifex <- ifelse(pop == 0, 0, as.numeric(lowlifex) / pop)
#> Cannot use formula: lowlifex_synonym <- ifelse(pop == 0, 0, as.numeric(lowlifex_synonym) / pop)
#> Using no2 <- ifelse(pop == 0, 0, as.numeric(no2) / pop)
#> Using o3 <- ifelse(pop == 0, 0, as.numeric(o3) / pop)
#> Cannot use formula: p_chinese <- ifelse(lan_universe == 0, 0, as.numeric(p_chinese) / lan_universe)
#> Cannot use formula: p_korean <- ifelse(lan_universe == 0, 0, as.numeric(p_korean) / lan_universe)
#> Using pctaa <- ifelse(pop == 0, 0, as.numeric(aa) / pop)
#> Using pctaiana <- ifelse(pop == 0, 0, as.numeric(aiana) / pop)
#> Using pctapi_li <- ifelse(lingiso == 0, 0, as.numeric(api_li) / lingiso)
#> Using pctba <- ifelse(pop == 0, 0, as.numeric(ba) / pop)
#> Using pctdisability <- ifelse(disab_universe == 0, 0, as.numeric(disability) / disab_universe)
#> Using pctfemale <- ifelse(pop == 0, 0, as.numeric(female) / pop)
#> Cannot use formula: pctfire <- ifelse(pop == 0, 0, as.numeric(fire) / pop)
#> Cannot use formula: pctfire30 <- ifelse(pop == 0, 0, as.numeric(fire30) / pop)
#> Cannot use formula: pctflood <- ifelse(pop == 0, 0, as.numeric(flood) / pop)
#> Cannot use formula: pctflood30 <- ifelse(pop == 0, 0, as.numeric(flood30) / pop)
#> Using pcthisp <- ifelse(pop == 0, 0, as.numeric(hisp) / pop)
#> Using pctie_li <- ifelse(lingiso == 0, 0, as.numeric(ie_li) / lingiso)
#> Using pctlan_api <- ifelse(lan_universe == 0, 0, as.numeric(lan_api) / lan_universe)
#> Cannot use formula: pctlan_arabic <- ifelse(lan_universe == 0, 0, as.numeric(lan_arabic) / lan_universe)
#> Cannot use formula: pctlan_english <- ifelse(lan_universe == 0, 0, as.numeric(lan_english) / lan_universe)
#> Cannot use formula: pctlan_french <- ifelse(lan_universe == 0, 0, as.numeric(lan_french) / lan_universe)
#> Using pctlan_ie <- ifelse(lan_universe == 0, 0, as.numeric(lan_ie) / lan_universe)
#> Cannot use formula: pctlan_non_english <- ifelse(lan_universe == 0, 0, as.numeric(lan_non_english) / lan_universe)
#> Using pctlan_nonenglish <- ifelse(lan_universe == 0, 0, as.numeric(lan_nonenglish) / lan_universe)
#> Using pctlan_other <- ifelse(lan_universe == 0, 0, as.numeric(lan_other) / lan_universe)
#> Cannot use formula: pctlan_other_asian <- ifelse(lan_universe == 0, 0, as.numeric(lan_other_asian) / lan_universe)
#> Cannot use formula: pctlan_other_ie <- ifelse(lan_universe == 0, 0, as.numeric(lan_other_ie) / lan_universe)
#> Cannot use formula: pctlan_rus_pol_slav <- ifelse(lan_universe == 0, 0, as.numeric(lan_rus_pol_slav) / lan_universe)
#> Using pctlan_spanish <- ifelse(lan_universe == 0, 0, as.numeric(lan_spanish) / lan_universe)
#> Cannot use formula: pctlan_vietnamese <- ifelse(lan_universe == 0, 0, as.numeric(lan_vietnamese) / lan_universe)
#> Using pctlingiso <- ifelse(hhlds == 0, 0, as.numeric(lingiso) / hhlds)
#> Using pctlowinc <- ifelse(povknownratio == 0, 0, as.numeric(lowinc) / povknownratio)
#> Using pctlths <- ifelse(age25up == 0, 0, as.numeric(lths) / age25up)
#> Using pctmale <- ifelse(pop == 0, 0, as.numeric(male) / pop)
#> Cannot use formula: pctmin <- ifelse(pop == 0, 0, as.numeric(min) / pop)
#> Using pctmulti <- ifelse(pop == 0, 0, as.numeric(multi) / pop)
#> Using pctnhaa <- ifelse(pop == 0, 0, as.numeric(nhaa) / pop)
#> Using pctnhaiana <- ifelse(pop == 0, 0, as.numeric(nhaiana) / pop)
#> Using pctnhba <- ifelse(pop == 0, 0, as.numeric(nhba) / pop)
#> Using pctnhmulti <- ifelse(pop == 0, 0, as.numeric(nhmulti) / pop)
#> Using pctnhnhpia <- ifelse(pop == 0, 0, as.numeric(nhnhpia) / pop)
#> Using pctnhotheralone <- ifelse(pop == 0, 0, as.numeric(nhotheralone) / pop)
#> Using pctnhpia <- ifelse(pop == 0, 0, as.numeric(nhpia) / pop)
#> Using pctnhwa <- ifelse(pop == 0, 0, as.numeric(nhwa) / pop)
#> Using pctother_li <- ifelse(lingiso == 0, 0, as.numeric(other_li) / lingiso)
#> Using pctotheralone <- ifelse(pop == 0, 0, as.numeric(otheralone) / pop)
#> Using pctover17 <- ifelse(pop == 0, 0, as.numeric(over17) / pop)
#> Using pctover64 <- ifelse(pop == 0, 0, as.numeric(over64) / pop)
#> Using pctownedunits <- ifelse(occupiedunits == 0, 0, as.numeric(ownedunits) / occupiedunits)
#> Cannot use formula: pctownedunits_dupe <- ifelse(builtunits == 0, 0, as.numeric(ownedunits_dupe) / builtunits)
#> Using pctpoor <- ifelse(hhlds == 0, 0, as.numeric(poor) / hhlds)
#> Using pctpre1960 <- ifelse(builtunits == 0, 0, as.numeric(pre1960) / builtunits)
#> Using pctspanish_li <- ifelse(lingiso == 0, 0, as.numeric(spanish_li) / lingiso)
#> Using pctunder18 <- ifelse(pop == 0, 0, as.numeric(under18) / pop)
#> Using pctunder5 <- ifelse(pop == 0, 0, as.numeric(under5) / pop)
#> Using pctunemployed <- ifelse(unemployedbase == 0, 0, as.numeric(unemployed) / unemployedbase)
#> Using pctwa <- ifelse(pop == 0, 0, as.numeric(wa) / pop)
#> Using percapincome <- ifelse(pop == 0, 0, as.numeric(percapincome) / pop)
#> Using pm <- ifelse(pop == 0, 0, as.numeric(pm) / pop)
#> Using proximity.npdes <- ifelse(pop == 0, 0, as.numeric(proximity.npdes) / pop)
#> Using proximity.npl <- ifelse(pop == 0, 0, as.numeric(proximity.npl) / pop)
#> Using proximity.rmp <- ifelse(pop == 0, 0, as.numeric(proximity.rmp) / pop)
#> Using proximity.tsdf <- ifelse(pop == 0, 0, as.numeric(proximity.tsdf) / pop)
#> Cannot use formula: rateasthma <- ifelse(pop == 0, 0, as.numeric(rateasthma) / pop)
#> Cannot use formula: ratecancer <- ifelse(pop == 0, 0, as.numeric(ratecancer) / pop)
#> Cannot use formula: rateheartdisease <- ifelse(pop == 0, 0, as.numeric(rateheartdisease) / pop)
#> Using rsei <- ifelse(pop == 0, 0, as.numeric(rsei) / pop)
#> Cannot use formula: sitecount_avg <- ifelse(pop == 0, 0, as.numeric(sitecount_avg) / pop)
#> Cannot use formula: state.EJ.DISPARITY.dpm.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.dpm.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.dpm.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.dpm.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.drinking.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.drinking.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.drinking.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.drinking.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.no2.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.no2.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.no2.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.no2.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.o3.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.o3.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.o3.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.o3.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pctpre1960.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pre1960.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pctpre1960.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pre1960.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pm.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pm.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pm.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pm.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npdes.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npdes.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npdes.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npdes.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npl.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npl.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npl.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npl.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.rmp.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.rmp.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.rmp.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.rmp.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.tsdf.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.tsdf.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.tsdf.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.tsdf.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.rsei.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.rsei.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.rsei.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.rsei.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.traffic.score.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.traffic.score.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.traffic.score.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.traffic.score.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.ust.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.ust.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.ust.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.ust.supp) / pop)
#> Using traffic.score <- ifelse(pop == 0, 0, as.numeric(traffic.score) / pop)
#> Using ust <- ifelse(pop == 0, 0, as.numeric(ust) / pop)
t(summary(newdf1))
#>
#> bgid Min. :43898 1st Qu.:43900
#> pop Min. : 974 1st Qu.:1400
#> Demog.Index Min. :0.4376 1st Qu.:0.9709
#> Demog.Index.State Min. :0.5094 1st Qu.:1.1301
#> Demog.Index.Supp Min. :1.179 1st Qu.:1.300
#> Demog.Index.Supp.State Min. :0.9202 1st Qu.:1.0650
#> dpm Min. :0.08159 1st Qu.:0.08462
#> drinking Min. :0 1st Qu.:0
#> lifexyears Min. : 0.00 1st Qu.: 0.00
#> lowlifex Min. :0.1959 1st Qu.:0.1959
#> no2 Min. :3.427 1st Qu.:4.090
#> o3 Min. :60.46 1st Qu.:60.48
#> pctaa Min. :0.0000000 1st Qu.:0.0005435
#> pctaiana Min. :0.0000000 1st Qu.:0.0000000
#> pctapi_li Min. :0 1st Qu.:0
#> pctba Min. :0.008093 1st Qu.:0.122266
#> pctdisability Min. :0.1297 1st Qu.:0.1303
#> pctfemale Min. :0.3901 1st Qu.:0.4439
#> pcthisp Min. :0.00000 1st Qu.:0.01825
#> pctie_li Min. :0.0 1st Qu.:0.0
#> pctlan_api Min. :0.004086 1st Qu.:0.005615
#> pctlan_ie Min. :0.002125 1st Qu.:0.004426
#> pctlan_nonenglish Min. :0.03273 1st Qu.:0.05401
#> pctlan_other Min. :0.0000000 1st Qu.:0.0000000
#> pctlan_spanish Min. :0.01934 1st Qu.:0.02968
#> pctlingiso Min. :0.000000 1st Qu.:0.000000
#> pctlowinc Min. :0.03577 1st Qu.:0.19399
#> pctlths Min. :0.00000 1st Qu.:0.05163
#> pctmale Min. :0.4790 1st Qu.:0.4987
#> pctmin Min. :0.1430 1st Qu.:0.2174
#> pctmulti Min. :0.002149 1st Qu.:0.050674
#> pctnhaa Min. :0.0000000 1st Qu.:0.0005435
#> pctnhaiana Min. :0.0000000 1st Qu.:0.0000000
#> pctnhba Min. :0.008093 1st Qu.:0.118054
#> pctnhmulti Min. :0.00000 1st Qu.:0.01905
#> pctnhnhpia Min. :0 1st Qu.:0
#> pctnhotheralone Min. :0.0000000 1st Qu.:0.0000000
#> pctnhpia Min. :0 1st Qu.:0
#> pctnhwa Min. :0.3496 1st Qu.:0.4804
#> pctother_li Min. :0 1st Qu.:0
#> pctotheralone Min. :0.000000 1st Qu.:0.000000
#> pctover17 Min. :0.6428 1st Qu.:0.6864
#> pctover64 Min. :0.08419 1st Qu.:0.12670
#> pctownedunits Min. :0.4255 1st Qu.:0.6552
#> pctpoor Min. :0.02128 1st Qu.:0.03988
#> pctpre1960 Min. :0.00000 1st Qu.:0.02755
#> pctspanish_li Min. :0.0 1st Qu.:0.0
#> pctunder18 Min. :0.2058 1st Qu.:0.2208
#> pctunder5 Min. :0.01387 1st Qu.:0.05284
#> pctunemployed Min. :0.00000 1st Qu.:0.02953
#> pctwa Min. :0.3805 1st Qu.:0.4913
#> percapincome Min. :25866 1st Qu.:31610
#> pm Min. :6.073 1st Qu.:6.073
#> proximity.npdes Min. : 0 1st Qu.: 0
#> proximity.npl Min. :0.0000 1st Qu.:0.0000
#> proximity.rmp Min. :0.09494 1st Qu.:0.15919
#> proximity.tsdf Min. :0.00000 1st Qu.:0.00000
#> rsei Min. : 30.29 1st Qu.:138.58
#> traffic.score Min. : 52506 1st Qu.:105095
#> ust Min. :0.00000 1st Qu.:0.00000
#>
#> bgid Median :43902 Mean :43902
#> pop Median :1593 Mean :1789
#> Demog.Index Median :1.0386 Mean :1.0756
#> Demog.Index.State Median :1.2065 Mean :1.2495
#> Demog.Index.Supp Median :1.418 Mean :1.433
#> Demog.Index.Supp.State Median :1.2175 Mean :1.2610
#> dpm Median :0.10104 Mean :0.11307
#> drinking Median :0 Mean :0
#> lifexyears Median :76.00 Mean :46.32
#> lowlifex Median :0.2082 Mean :0.2082
#> no2 Median :5.508 Mean :5.431
#> o3 Median :60.51 Mean :60.54
#> pctaa Median :0.0130199 Mean :0.0153601
#> pctaiana Median :0.0000000 Mean :0.0006076
#> pctapi_li Median :0 Mean :0
#> pctba Median :0.252765 Mean :0.239239
#> pctdisability Median :0.1320 Mean :0.1351
#> pctfemale Median :0.4632 Mean :0.4677
#> pcthisp Median :0.05927 Mean :0.06760
#> pctie_li Median :0.0 Mean :0.1
#> pctlan_api Median :0.010202 Mean :0.021895
#> pctlan_ie Median :0.011328 Mean :0.025772
#> pctlan_nonenglish Median :0.11787 Mean :0.09700
#> pctlan_other Median :0.0000000 Mean :0.0003188
#> pctlan_spanish Median :0.06070 Mean :0.04902
#> pctlingiso Median :0.000000 Mean :0.007652
#> pctlowinc Median :0.22611 Mean :0.21416
#> pctlths Median :0.07766 Mean :0.07360
#> pctmale Median :0.5368 Mean :0.5323
#> pctmin Median :0.3481 Mean :0.3616
#> pctmulti Median :0.079986 Mean :0.078599
#> pctnhaa Median :0.0130199 Mean :0.0119947
#> pctnhaiana Median :0.0000000 Mean :0.0006076
#> pctnhba Median :0.252585 Mean :0.238642
#> pctnhmulti Median :0.02329 Mean :0.04075
#> pctnhnhpia Median :0 Mean :0
#> pctnhotheralone Median :0.0000000 Mean :0.0020395
#> pctnhpia Median :0 Mean :0
#> pctnhwa Median :0.6519 Mean :0.6384
#> pctother_li Median :0 Mean :0
#> pctotheralone Median :0.007131 Mean :0.013417
#> pctover17 Median :0.7350 Mean :0.7271
#> pctover64 Median :0.13562 Mean :0.15591
#> pctownedunits Median :0.8531 Mean :0.7843
#> pctpoor Median :0.06827 Mean :0.08036
#> pctpre1960 Median :0.08206 Mean :0.13686
#> pctspanish_li Median :0.0 Mean :0.1
#> pctunder18 Median :0.2650 Mean :0.2729
#> pctunder5 Median :0.05537 Mean :0.06318
#> pctunemployed Median :0.04158 Mean :0.05324
#> pctwa Median :0.6879 Mean :0.6528
#> percapincome Median :34068 Mean :34595
#> pm Median :6.228 Mean :6.232
#> proximity.npdes Median : 0 Mean : 1566
#> proximity.npl Median :0.0000 Mean :0.0147
#> proximity.rmp Median :0.21555 Mean :0.32247
#> proximity.tsdf Median :0.00000 Mean :0.03422
#> rsei Median :414.50 Mean :378.13
#> traffic.score Median :232698 Mean :252647
#> ust Median :0.01026 Mean :0.91212
#>
#> bgid 3rd Qu.:43905 Max. :43907
#> pop 3rd Qu.:2212 Max. :2778
#> Demog.Index 3rd Qu.:1.1778 Max. :1.7481
#> Demog.Index.State 3rd Qu.:1.3677 Max. :2.0318
#> Demog.Index.Supp 3rd Qu.:1.590 Max. :1.674
#> Demog.Index.Supp.State 3rd Qu.:1.4723 Max. :1.6874
#> dpm 3rd Qu.:0.14244 Max. :0.16092
#> drinking 3rd Qu.:0 Max. :0
#> lifexyears 3rd Qu.:77.80 Max. :78.40
#> lowlifex 3rd Qu.:0.2205 Max. :0.2205 NA's :4
#> no2 3rd Qu.:6.692 Max. :7.376
#> o3 3rd Qu.:60.61 Max. :60.64
#> pctaa 3rd Qu.:0.0200330 Max. :0.0556319
#> pctaiana 3rd Qu.:0.0000000 Max. :0.0043478
#> pctapi_li 3rd Qu.:0 Max. :0
#> pctba 3rd Qu.:0.377039 Max. :0.447937
#> pctdisability 3rd Qu.:0.1415 Max. :0.1415
#> pctfemale 3rd Qu.:0.5013 Max. :0.5210
#> pcthisp 3rd Qu.:0.09695 Max. :0.19231
#> pctie_li 3rd Qu.:0.0 Max. :1.0
#> pctlan_api 3rd Qu.:0.044021 Max. :0.044021
#> pctlan_ie 3rd Qu.:0.054340 Max. :0.068677
#> pctlan_nonenglish 3rd Qu.:0.12956 Max. :0.13346
#> pctlan_other 3rd Qu.:0.0007970 Max. :0.0010627
#> pctlan_spanish 3rd Qu.:0.06252 Max. :0.06252
#> pctlingiso 3rd Qu.:0.000000 Max. :0.061977
#> pctlowinc 3rd Qu.:0.29638 Max. :0.31618
#> pctlths 3rd Qu.:0.09068 Max. :0.12894
#> pctmale 3rd Qu.:0.5561 Max. :0.6099
#> pctmin 3rd Qu.:0.5196 Max. :0.6504
#> pctmulti 3rd Qu.:0.110414 Max. :0.152473
#> pctnhaa 3rd Qu.:0.0200330 Max. :0.0300860
#> pctnhaiana 3rd Qu.:0.0000000 Max. :0.0043478
#> pctnhba 3rd Qu.:0.377039 Max. :0.447937
#> pctnhmulti 3rd Qu.:0.05514 Max. :0.11304
#> pctnhnhpia 3rd Qu.:0 Max. :0
#> pctnhotheralone 3rd Qu.:0.0009719 Max. :0.0133189
#> pctnhpia 3rd Qu.:0 Max. :0
#> pctnhwa 3rd Qu.:0.7826 Max. :0.8570
#> pctother_li 3rd Qu.:0 Max. :0
#> pctotheralone 3rd Qu.:0.026320 Max. :0.042775
#> pctover17 3rd Qu.:0.7792 Max. :0.7942
#> pctover64 3rd Qu.:0.15010 Max. :0.33379
#> pctownedunits 3rd Qu.:0.9308 Max. :1.0000
#> pctpoor 3rd Qu.:0.08706 Max. :0.26137
#> pctpre1960 3rd Qu.:0.14682 Max. :0.62611
#> pctspanish_li 3rd Qu.:0.0 Max. :1.0
#> pctunder18 3rd Qu.:0.3136 Max. :0.3572
#> pctunder5 3rd Qu.:0.06853 Max. :0.13333
#> pctunemployed 3rd Qu.:0.06854 Max. :0.14286
#> pctwa 3rd Qu.:0.7977 Max. :0.8570
#> percapincome 3rd Qu.:38143 Max. :41652
#> pm 3rd Qu.:6.393 Max. :6.448
#> proximity.npdes 3rd Qu.: 0 Max. :15656
#> proximity.npl 3rd Qu.:0.0000 Max. :0.0809
#> proximity.rmp 3rd Qu.:0.33073 Max. :1.21004
#> proximity.tsdf 3rd Qu.:0.07553 Max. :0.09791
#> rsei 3rd Qu.:618.10 Max. :659.39
#> traffic.score 3rd Qu.:388154 Max. :520089
#> ust 3rd Qu.:1.76949 Max. :3.55402
bgdf <- data.frame(blockgroupstats)
newdf <- calc_ejam(bgdf,
keep.old = c('bgid', 'pop', 'hisp'),
keep.new = "all",
formulas = formulas_d
)
#> Using Demog.Index <- ifelse(pop == 0, 0, as.numeric(Demog.Index) / pop)
#> Using Demog.Index.State <- ifelse(pop == 0, 0, as.numeric(Demog.Index.State) / pop)
#> Using Demog.Index.Supp <- ifelse(pop == 0, 0, as.numeric(Demog.Index.Supp) / pop)
#> Using Demog.Index.Supp.State <- ifelse(pop == 0, 0, as.numeric(Demog.Index.Supp.State) / pop)
#> Using dpm <- ifelse(pop == 0, 0, as.numeric(dpm) / pop)
#> Using drinking <- ifelse(pop == 0, 0, as.numeric(drinking) / pop)
#> Cannot use formula: EJ.DISPARITY.dpm.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.dpm.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.dpm.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.dpm.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.drinking.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.drinking.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.drinking.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.drinking.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.no2.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.no2.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.no2.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.no2.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.o3.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.o3.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.o3.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.o3.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.pctpre1960.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pre1960.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.pctpre1960.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pre1960.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.pm.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pm.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.pm.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.pm.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npdes.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npdes.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npdes.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npdes.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npl.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npl.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.npl.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.npl.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.rmp.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.rmp.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.rmp.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.rmp.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.tsdf.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.tsdf.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.proximity.tsdf.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.proximity.tsdf.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.rsei.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.rsei.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.rsei.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.rsei.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.traffic.score.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.traffic.score.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.traffic.score.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.traffic.score.supp) / pop)
#> Cannot use formula: EJ.DISPARITY.ust.eo <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.ust.eo) / pop)
#> Cannot use formula: EJ.DISPARITY.ust.supp <- ifelse(pop == 0, 0, as.numeric(EJ.DISPARITY.ust.supp) / pop)
#> Using lifexyears <- ifelse(pop == 0, 0, as.numeric(lifexyears) / pop)
#> Using lowlifex <- ifelse(pop == 0, 0, as.numeric(lowlifex) / pop)
#> Cannot use formula: lowlifex_synonym <- ifelse(pop == 0, 0, as.numeric(lowlifex_synonym) / pop)
#> Using no2 <- ifelse(pop == 0, 0, as.numeric(no2) / pop)
#> Using o3 <- ifelse(pop == 0, 0, as.numeric(o3) / pop)
#> Cannot use formula: p_chinese <- ifelse(lan_universe == 0, 0, as.numeric(p_chinese) / lan_universe)
#> Cannot use formula: p_korean <- ifelse(lan_universe == 0, 0, as.numeric(p_korean) / lan_universe)
#> Using pctaa <- ifelse(pop == 0, 0, as.numeric(aa) / pop)
#> Using pctaiana <- ifelse(pop == 0, 0, as.numeric(aiana) / pop)
#> Using pctapi_li <- ifelse(lingiso == 0, 0, as.numeric(api_li) / lingiso)
#> Using pctba <- ifelse(pop == 0, 0, as.numeric(ba) / pop)
#> Using pctdisability <- ifelse(disab_universe == 0, 0, as.numeric(disability) / disab_universe)
#> Using pctfemale <- ifelse(pop == 0, 0, as.numeric(female) / pop)
#> Cannot use formula: pctfire <- ifelse(pop == 0, 0, as.numeric(fire) / pop)
#> Cannot use formula: pctfire30 <- ifelse(pop == 0, 0, as.numeric(fire30) / pop)
#> Cannot use formula: pctflood <- ifelse(pop == 0, 0, as.numeric(flood) / pop)
#> Cannot use formula: pctflood30 <- ifelse(pop == 0, 0, as.numeric(flood30) / pop)
#> Using pcthisp <- ifelse(pop == 0, 0, as.numeric(hisp) / pop)
#> Using pctie_li <- ifelse(lingiso == 0, 0, as.numeric(ie_li) / lingiso)
#> Using pctlan_api <- ifelse(lan_universe == 0, 0, as.numeric(lan_api) / lan_universe)
#> Cannot use formula: pctlan_arabic <- ifelse(lan_universe == 0, 0, as.numeric(lan_arabic) / lan_universe)
#> Cannot use formula: pctlan_english <- ifelse(lan_universe == 0, 0, as.numeric(lan_english) / lan_universe)
#> Cannot use formula: pctlan_french <- ifelse(lan_universe == 0, 0, as.numeric(lan_french) / lan_universe)
#> Using pctlan_ie <- ifelse(lan_universe == 0, 0, as.numeric(lan_ie) / lan_universe)
#> Cannot use formula: pctlan_non_english <- ifelse(lan_universe == 0, 0, as.numeric(lan_non_english) / lan_universe)
#> Using pctlan_nonenglish <- ifelse(lan_universe == 0, 0, as.numeric(lan_nonenglish) / lan_universe)
#> Using pctlan_other <- ifelse(lan_universe == 0, 0, as.numeric(lan_other) / lan_universe)
#> Cannot use formula: pctlan_other_asian <- ifelse(lan_universe == 0, 0, as.numeric(lan_other_asian) / lan_universe)
#> Cannot use formula: pctlan_other_ie <- ifelse(lan_universe == 0, 0, as.numeric(lan_other_ie) / lan_universe)
#> Cannot use formula: pctlan_rus_pol_slav <- ifelse(lan_universe == 0, 0, as.numeric(lan_rus_pol_slav) / lan_universe)
#> Using pctlan_spanish <- ifelse(lan_universe == 0, 0, as.numeric(lan_spanish) / lan_universe)
#> Cannot use formula: pctlan_vietnamese <- ifelse(lan_universe == 0, 0, as.numeric(lan_vietnamese) / lan_universe)
#> Using pctlingiso <- ifelse(hhlds == 0, 0, as.numeric(lingiso) / hhlds)
#> Using pctlowinc <- ifelse(povknownratio == 0, 0, as.numeric(lowinc) / povknownratio)
#> Using pctlths <- ifelse(age25up == 0, 0, as.numeric(lths) / age25up)
#> Using pctmale <- ifelse(pop == 0, 0, as.numeric(male) / pop)
#> Cannot use formula: pctmin <- ifelse(pop == 0, 0, as.numeric(min) / pop)
#> Using pctmulti <- ifelse(pop == 0, 0, as.numeric(multi) / pop)
#> Using pctnhaa <- ifelse(pop == 0, 0, as.numeric(nhaa) / pop)
#> Using pctnhaiana <- ifelse(pop == 0, 0, as.numeric(nhaiana) / pop)
#> Using pctnhba <- ifelse(pop == 0, 0, as.numeric(nhba) / pop)
#> Using pctnhmulti <- ifelse(pop == 0, 0, as.numeric(nhmulti) / pop)
#> Using pctnhnhpia <- ifelse(pop == 0, 0, as.numeric(nhnhpia) / pop)
#> Using pctnhotheralone <- ifelse(pop == 0, 0, as.numeric(nhotheralone) / pop)
#> Using pctnhpia <- ifelse(pop == 0, 0, as.numeric(nhpia) / pop)
#> Using pctnhwa <- ifelse(pop == 0, 0, as.numeric(nhwa) / pop)
#> Using pctother_li <- ifelse(lingiso == 0, 0, as.numeric(other_li) / lingiso)
#> Using pctotheralone <- ifelse(pop == 0, 0, as.numeric(otheralone) / pop)
#> Using pctover17 <- ifelse(pop == 0, 0, as.numeric(over17) / pop)
#> Using pctover64 <- ifelse(pop == 0, 0, as.numeric(over64) / pop)
#> Using pctownedunits <- ifelse(occupiedunits == 0, 0, as.numeric(ownedunits) / occupiedunits)
#> Cannot use formula: pctownedunits_dupe <- ifelse(builtunits == 0, 0, as.numeric(ownedunits_dupe) / builtunits)
#> Using pctpoor <- ifelse(hhlds == 0, 0, as.numeric(poor) / hhlds)
#> Using pctpre1960 <- ifelse(builtunits == 0, 0, as.numeric(pre1960) / builtunits)
#> Using pctspanish_li <- ifelse(lingiso == 0, 0, as.numeric(spanish_li) / lingiso)
#> Using pctunder18 <- ifelse(pop == 0, 0, as.numeric(under18) / pop)
#> Using pctunder5 <- ifelse(pop == 0, 0, as.numeric(under5) / pop)
#> Using pctunemployed <- ifelse(unemployedbase == 0, 0, as.numeric(unemployed) / unemployedbase)
#> Using pctwa <- ifelse(pop == 0, 0, as.numeric(wa) / pop)
#> Using percapincome <- ifelse(pop == 0, 0, as.numeric(percapincome) / pop)
#> Using pm <- ifelse(pop == 0, 0, as.numeric(pm) / pop)
#> Using proximity.npdes <- ifelse(pop == 0, 0, as.numeric(proximity.npdes) / pop)
#> Using proximity.npl <- ifelse(pop == 0, 0, as.numeric(proximity.npl) / pop)
#> Using proximity.rmp <- ifelse(pop == 0, 0, as.numeric(proximity.rmp) / pop)
#> Using proximity.tsdf <- ifelse(pop == 0, 0, as.numeric(proximity.tsdf) / pop)
#> Cannot use formula: rateasthma <- ifelse(pop == 0, 0, as.numeric(rateasthma) / pop)
#> Cannot use formula: ratecancer <- ifelse(pop == 0, 0, as.numeric(ratecancer) / pop)
#> Cannot use formula: rateheartdisease <- ifelse(pop == 0, 0, as.numeric(rateheartdisease) / pop)
#> Using rsei <- ifelse(pop == 0, 0, as.numeric(rsei) / pop)
#> Cannot use formula: sitecount_avg <- ifelse(pop == 0, 0, as.numeric(sitecount_avg) / pop)
#> Cannot use formula: state.EJ.DISPARITY.dpm.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.dpm.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.dpm.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.dpm.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.drinking.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.drinking.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.drinking.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.drinking.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.no2.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.no2.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.no2.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.no2.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.o3.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.o3.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.o3.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.o3.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pctpre1960.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pre1960.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pctpre1960.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pre1960.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pm.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pm.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.pm.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.pm.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npdes.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npdes.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npdes.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npdes.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npl.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npl.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.npl.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.npl.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.rmp.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.rmp.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.rmp.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.rmp.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.tsdf.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.tsdf.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.proximity.tsdf.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.proximity.tsdf.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.rsei.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.rsei.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.rsei.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.rsei.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.traffic.score.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.traffic.score.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.traffic.score.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.traffic.score.supp) / pop)
#> Cannot use formula: state.EJ.DISPARITY.ust.eo <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.ust.eo) / pop)
#> Cannot use formula: state.EJ.DISPARITY.ust.supp <- ifelse(pop == 0, 0, as.numeric(state.EJ.DISPARITY.ust.supp) / pop)
#> Using traffic.score <- ifelse(pop == 0, 0, as.numeric(traffic.score) / pop)
#> Using ust <- ifelse(pop == 0, 0, as.numeric(ust) / pop)
round(t(newdf[1001:1002, ]), 3)
#> 1001 1002
#> bgid 1001.000 1002.000
#> pop 817.000 1138.000
#> hisp 0.000 185.000
#> Demog.Index 1.851 2.681
#> Demog.Index.State 1.845 2.663
#> Demog.Index.Supp 2.250 2.642
#> Demog.Index.Supp.State 2.215 2.604
#> dpm 0.128 0.134
#> drinking 25.000 25.000
#> lifexyears 67.900 72.700
#> lowlifex 0.304 0.254
#> no2 5.842 6.936
#> o3 53.271 53.275
#> pctaa 0.000 0.000
#> pctaiana 0.000 0.000
#> pctapi_li 0.000 0.000
#> pctba 0.601 0.521
#> pctdisability 0.207 0.222
#> pctfemale 0.490 0.474
#> pcthisp 0.000 0.163
#> pctie_li 0.000 0.000
#> pctlan_api 0.000 0.000
#> pctlan_ie 0.000 0.000
#> pctlan_nonenglish 0.021 0.070
#> pctlan_other 0.000 0.000
#> pctlan_spanish 0.021 0.070
#> pctlingiso 0.000 0.000
#> pctlowinc 0.383 0.654
#> pctlths 0.031 0.227
#> pctmale 0.510 0.526
#> pctmin 0.601 0.723
#> pctmulti 0.000 0.095
#> pctnhaa 0.000 0.000
#> pctnhaiana 0.000 0.000
#> pctnhba 0.601 0.521
#> pctnhmulti 0.000 0.040
#> pctnhnhpia 0.000 0.000
#> pctnhotheralone 0.000 0.000
#> pctnhpia 0.000 0.000
#> pctnhwa 0.399 0.277
#> pctother_li 0.000 0.000
#> pctotheralone 0.000 0.098
#> pctover17 0.655 0.743
#> pctover64 0.086 0.128
#> pctownedunits 0.664 0.524
#> pctpoor 0.188 0.384
#> pctpre1960 0.606 0.747
#> pctspanish_li 0.000 0.000
#> pctunder18 0.345 0.257
#> pctunder5 0.080 0.063
#> pctunemployed 0.071 0.197
#> pctwa 0.399 0.286
#> percapincome 14674.000 18152.000
#> pm 8.596 8.580
#> proximity.npdes 23.049 22.497
#> proximity.npl 0.000 0.000
#> proximity.rmp 2.265 1.971
#> proximity.tsdf 0.539 0.883
#> rsei 9264.706 6974.332
#> traffic.score 645688.455 790976.062
#> ust 1.672 3.349
cbind(
newdf[1001:1031, c('hisp', 'pop', 'pcthisp')],
check = (newdf$hisp[1001:1031] / newdf$pop[1001:1031])
)
#> hisp pop pcthisp check
#> 1001 0 817 0.000000000 0.000000000
#> 1002 185 1138 0.162565905 0.162565905
#> 1003 0 1674 0.000000000 0.000000000
#> 1004 0 736 0.000000000 0.000000000
#> 1005 82 1622 0.050554871 0.050554871
#> 1006 17 1315 0.012927757 0.012927757
#> 1007 38 446 0.085201794 0.085201794
#> 1008 122 1625 0.075076923 0.075076923
#> 1009 0 602 0.000000000 0.000000000
#> 1010 0 574 0.000000000 0.000000000
#> 1011 0 1096 0.000000000 0.000000000
#> 1012 46 1022 0.045009785 0.045009785
#> 1013 142 1527 0.092992796 0.092992796
#> 1014 0 784 0.000000000 0.000000000
#> 1015 17 574 0.029616725 0.029616725
#> 1016 0 391 0.000000000 0.000000000
#> 1017 1 957 0.001044932 0.001044932
#> 1018 156 1330 0.117293233 0.117293233
#> 1019 0 871 0.000000000 0.000000000
#> 1020 60 871 0.068886338 0.068886338
#> 1021 17 922 0.018438178 0.018438178
#> 1022 0 453 0.000000000 0.000000000
#> 1023 149 2040 0.073039216 0.073039216
#> 1024 0 845 0.000000000 0.000000000
#> 1025 10 860 0.011627907 0.011627907
#> 1026 0 612 0.000000000 0.000000000
#> 1027 0 1416 0.000000000 0.000000000
#> 1028 17 815 0.020858896 0.020858896
#> 1029 109 1551 0.070277240 0.070277240
#> 1030 0 941 0.000000000 0.000000000
#> 1031 177 1198 0.147746244 0.147746244
## note the 0-100 percentages in blockgroupstats versus the 0-1 calculated percentages
cbind(round(sapply(newdf, max, na.rm=T),2),
names(newdf) %in% names_pct_as_fraction_blockgroupstats)
#> [,1] [,2]
#> bgid 2.423550e+05 0
#> pop 3.890700e+04 0
#> hisp 1.319000e+04 0
#> Demog.Index 3.930000e+00 0
#> Demog.Index.State 6.610000e+00 0
#> Demog.Index.Supp 6.700000e+00 0
#> Demog.Index.Supp.State 7.810000e+00 0
#> dpm 2.980000e+00 0
#> drinking 8.990000e+02 0
#> lifexyears 9.750000e+01 0
#> lowlifex 4.200000e-01 1
#> no2 2.527000e+01 0
#> o3 1.128100e+02 0
#> pctaa 1.000000e+00 1
#> pctaiana 1.000000e+00 1
#> pctapi_li 1.000000e+00 1
#> pctba 1.000000e+00 1
#> pctdisability 1.000000e+00 1
#> pctfemale 1.000000e+00 1
#> pcthisp 1.000000e+00 1
#> pctie_li 1.000000e+00 1
#> pctlan_api 1.000000e+00 1
#> pctlan_ie 1.000000e+00 1
#> pctlan_nonenglish 1.000000e+00 0
#> pctlan_other 1.000000e+00 1
#> pctlan_spanish 1.000000e+00 1
#> pctlingiso 1.000000e+00 1
#> pctlowinc 1.000000e+00 1
#> pctlths 1.000000e+00 1
#> pctmale 1.000000e+00 1
#> pctmin 1.000000e+00 1
#> pctmulti 1.000000e+00 1
#> pctnhaa 1.000000e+00 1
#> pctnhaiana 1.000000e+00 1
#> pctnhba 1.000000e+00 1
#> pctnhmulti 1.000000e+00 1
#> pctnhnhpia 7.900000e-01 1
#> pctnhotheralone 6.100000e-01 1
#> pctnhpia 7.900000e-01 1
#> pctnhwa 1.000000e+00 1
#> pctother_li 1.000000e+00 1
#> pctotheralone 1.000000e+00 1
#> pctover17 1.000000e+00 1
#> pctover64 1.000000e+00 1
#> pctownedunits 1.000000e+00 1
#> pctpoor 1.000000e+00 1
#> pctpre1960 1.000000e+00 0
#> pctspanish_li 1.000000e+00 1
#> pctunder18 1.000000e+00 1
#> pctunder5 5.700000e-01 1
#> pctunemployed 1.000000e+00 1
#> pctwa 1.000000e+00 1
#> percapincome 1.063999e+06 0
#> pm 2.561000e+01 0
#> proximity.npdes 7.709095e+09 0
#> proximity.npl 4.608000e+01 0
#> proximity.rmp 1.806000e+01 0
#> proximity.tsdf 8.228000e+01 0
#> rsei 4.512172e+06 0
#> traffic.score 3.018180e+07 0
#> ust 1.378700e+02 0
EJAM:::formula_varname(formulas_d)
#> [1] "Demog.Index"
#> [2] "Demog.Index.State"
#> [3] "Demog.Index.Supp"
#> [4] "Demog.Index.Supp.State"
#> [5] "dpm"
#> [6] "drinking"
#> [7] "EJ.DISPARITY.dpm.eo"
#> [8] "EJ.DISPARITY.dpm.supp"
#> [9] "EJ.DISPARITY.drinking.eo"
#> [10] "EJ.DISPARITY.drinking.supp"
#> [11] "EJ.DISPARITY.no2.eo"
#> [12] "EJ.DISPARITY.no2.supp"
#> [13] "EJ.DISPARITY.o3.eo"
#> [14] "EJ.DISPARITY.o3.supp"
#> [15] "EJ.DISPARITY.pctpre1960.eo"
#> [16] "EJ.DISPARITY.pctpre1960.supp"
#> [17] "EJ.DISPARITY.pm.eo"
#> [18] "EJ.DISPARITY.pm.supp"
#> [19] "EJ.DISPARITY.proximity.npdes.eo"
#> [20] "EJ.DISPARITY.proximity.npdes.supp"
#> [21] "EJ.DISPARITY.proximity.npl.eo"
#> [22] "EJ.DISPARITY.proximity.npl.supp"
#> [23] "EJ.DISPARITY.proximity.rmp.eo"
#> [24] "EJ.DISPARITY.proximity.rmp.supp"
#> [25] "EJ.DISPARITY.proximity.tsdf.eo"
#> [26] "EJ.DISPARITY.proximity.tsdf.supp"
#> [27] "EJ.DISPARITY.rsei.eo"
#> [28] "EJ.DISPARITY.rsei.supp"
#> [29] "EJ.DISPARITY.traffic.score.eo"
#> [30] "EJ.DISPARITY.traffic.score.supp"
#> [31] "EJ.DISPARITY.ust.eo"
#> [32] "EJ.DISPARITY.ust.supp"
#> [33] "lifexyears"
#> [34] "lowlifex"
#> [35] "lowlifex_synonym"
#> [36] "no2"
#> [37] "o3"
#> [38] "p_chinese"
#> [39] "p_korean"
#> [40] "pctaa"
#> [41] "pctaiana"
#> [42] "pctapi_li"
#> [43] "pctba"
#> [44] "pctdisability"
#> [45] "pctfemale"
#> [46] "pctfire"
#> [47] "pctfire30"
#> [48] "pctflood"
#> [49] "pctflood30"
#> [50] "pcthisp"
#> [51] "pctie_li"
#> [52] "pctlan_api"
#> [53] "pctlan_arabic"
#> [54] "pctlan_english"
#> [55] "pctlan_french"
#> [56] "pctlan_ie"
#> [57] "pctlan_non_english"
#> [58] "pctlan_nonenglish"
#> [59] "pctlan_other"
#> [60] "pctlan_other_asian"
#> [61] "pctlan_other_ie"
#> [62] "pctlan_rus_pol_slav"
#> [63] "pctlan_spanish"
#> [64] "pctlan_vietnamese"
#> [65] "pctlingiso"
#> [66] "pctlowinc"
#> [67] "pctlths"
#> [68] "pctmale"
#> [69] "pctmin"
#> [70] "pctmulti"
#> [71] "pctnhaa"
#> [72] "pctnhaiana"
#> [73] "pctnhba"
#> [74] "pctnhmulti"
#> [75] "pctnhnhpia"
#> [76] "pctnhotheralone"
#> [77] "pctnhpia"
#> [78] "pctnhwa"
#> [79] "pctother_li"
#> [80] "pctotheralone"
#> [81] "pctover17"
#> [82] "pctover64"
#> [83] "pctownedunits"
#> [84] "pctownedunits_dupe"
#> [85] "pctpoor"
#> [86] "pctpre1960"
#> [87] "pctspanish_li"
#> [88] "pctunder18"
#> [89] "pctunder5"
#> [90] "pctunemployed"
#> [91] "pctwa"
#> [92] "percapincome"
#> [93] "pm"
#> [94] "proximity.npdes"
#> [95] "proximity.npl"
#> [96] "proximity.rmp"
#> [97] "proximity.tsdf"
#> [98] "rateasthma"
#> [99] "ratecancer"
#> [100] "rateheartdisease"
#> [101] "rsei"
#> [102] "sitecount_avg"
#> [103] "state.EJ.DISPARITY.dpm.eo"
#> [104] "state.EJ.DISPARITY.dpm.supp"
#> [105] "state.EJ.DISPARITY.drinking.eo"
#> [106] "state.EJ.DISPARITY.drinking.supp"
#> [107] "state.EJ.DISPARITY.no2.eo"
#> [108] "state.EJ.DISPARITY.no2.supp"
#> [109] "state.EJ.DISPARITY.o3.eo"
#> [110] "state.EJ.DISPARITY.o3.supp"
#> [111] "state.EJ.DISPARITY.pctpre1960.eo"
#> [112] "state.EJ.DISPARITY.pctpre1960.supp"
#> [113] "state.EJ.DISPARITY.pm.eo"
#> [114] "state.EJ.DISPARITY.pm.supp"
#> [115] "state.EJ.DISPARITY.proximity.npdes.eo"
#> [116] "state.EJ.DISPARITY.proximity.npdes.supp"
#> [117] "state.EJ.DISPARITY.proximity.npl.eo"
#> [118] "state.EJ.DISPARITY.proximity.npl.supp"
#> [119] "state.EJ.DISPARITY.proximity.rmp.eo"
#> [120] "state.EJ.DISPARITY.proximity.rmp.supp"
#> [121] "state.EJ.DISPARITY.proximity.tsdf.eo"
#> [122] "state.EJ.DISPARITY.proximity.tsdf.supp"
#> [123] "state.EJ.DISPARITY.rsei.eo"
#> [124] "state.EJ.DISPARITY.rsei.supp"
#> [125] "state.EJ.DISPARITY.traffic.score.eo"
#> [126] "state.EJ.DISPARITY.traffic.score.supp"
#> [127] "state.EJ.DISPARITY.ust.eo"
#> [128] "state.EJ.DISPARITY.ust.supp"
#> [129] "traffic.score"
#> [130] "ust"
#> attr(,"ejam_package_version")
#> Version
#> "2.32.0"
#> attr(,"ejscreen_version")
#> EJScreenVersion
#> "2.32"
#> attr(,"ejscreen_releasedate")
#> EJScreenReleaseDate
#> "2024-08-12"
#> attr(,"acs_releasedate")
#> ACSReleaseDate
#> "2023-12-07"
#> attr(,"acs_version")
#> ACSVersion
#> "2018-2022"
#> attr(,"census_version")
#> CensusVersion
#> "2020"
#> attr(,"date_saved_in_package")
#> [1] "2024-10-12"
rm(bgdf)