View source: R/RR.cut.if.gone.R
RR.cut.if.gone | R Documentation |
As with RR function, calculates RR as ratio of means in one demographic group vs reference, based on Census demographic data and environmental indicator data on each place. Then this finds how much smaller RR would be if the given place did not exist.
RR.cut.if.gone(e, d, pop, dref, na.rm = TRUE)
e |
environmental indicator value |
d |
demog group as fraction of pop |
pop |
pop count |
dref |
reference demog group as fraction |
na.rm |
TRUE by default, should NA values be removed first |
# x=RR.cut.if.gone(bg[ , names.e[8]], bg$pctlowinc, bg$pop)
# summary(x*1000)
mydat=data.frame(AQI=99:101, pctlowinc=c(0.20,0.30,0.40), pop=rep(1000,3))
RR(mydat$AQI, mydat$pctlowinc, mydat$pop)
RR.cut.if.gone(e=mydat$AQI, d=mydat$pctlowinc, pop=mydat$pop)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.