RR.if.address.top.x: Analyze how much RR would change if top-ranked places were...

View source: R/RR.if.address.top.x.R

RR.if.address.top.xR Documentation

Analyze how much RR would change if top-ranked places were addressed - ** NOT WORKING/ IN PROGRESS

Description

Function to analyze data on demographic and environmental (e) indicators by place (e.g., Census block group) to get stats on what percent of population or places could account for all risk ratio (RR, or ratio of mean e in one demog group vs others), and what is risk ratio if you reduce e (environmental indicator) by using some multiplier on e, in top x percent of places

Usage

RR.if.address.top.x(
  rank.by.df,
  e.df,
  d.pct,
  popcounts,
  d.pct.us,
  or.tied = TRUE,
  if.multiply.e.by = 0,
  zones = NULL,
  mycuts = c(50, 80, 90:100),
  silent = TRUE
)

Arguments

rank.by.df

Data.frame of indicators to rank places by, when defining top places

e.df

Environmental indicators data.frame, one row per place, required.

d.pct

Demographic percentage, as fraction, defining what fraction of population in each place (row) is in demographic group of interest. Required.

popcounts

Numeric vector of counts of total population in each place

d.pct.us

xxxxx

or.tied

Logical value, optional, TRUE by default, in which case ties of ranking variable with a threshold value (value >= threshold) are included in places within that bin.

if.multiply.e.by

Optional, 0 by default. Specifies the number that environmental indicator values would be multiplied by in the scenario where some places are addressed. Zero means those top-ranked places would have the environmental indicator set to zero, while 0.9 would mean and 10 percent cut in the environmental indicator value.

zones

Subsets of places such as States

mycuts

optional vector of threshold values to analyze. Default is c(50,80,90:100)

silent

optional logical, default is TRUE, while FALSE means more information is printed

Details

The effects of one place on overall RR is related to an ej.index, which here is a metric describing one place's contribution to an overall metric of disparity. RR is one overall metric of disparity, the ratio of mean environmental indicator value in one demographic group over the mean in the reference group. If RR = E/e, where E=avg environmental indicator or risk in key demographic group and e= in reference group, another metric of disparity is the excess individual risk, or E-e. The excess population risk or excess cases would be (E-e) * p * d where p=total population and d=fraction that is in key demographic group. Various counterfactuals could be used here for scenario defining what it means to address the top places and what is used to define top places.

Value

Returns a list of results:

  1. rrs data.frame, one column per environmental indicator, one row per threshold value

  2. rrs2 data.frame, Relative risks 2

  3. state.tables A list

  4. worst.as.pct Worst as percent, vector as long as number of environmental indicators

  5. worst.as.pct.of.bgs Worst as percent of places (e.g., block groups)

See Also

RR() and RR.if.address.top.x() and ej.indexes() and ej.added()

Examples

 ## #

ejanalysis/ejanalysis documentation built on April 2, 2024, 10:12 a.m.