sim_riskbydistance: Simulate disparities as risk, pop density, and demographics...

View source: R/sim_riskbydistance.R

sim_riskbydistanceR Documentation

Simulate disparities as risk, pop density, and demographics vary by distance

Description

Creates a simple set of 100 distances and at each distance simulated demographics, risk levels, population density and size, etc. Useful to see how those decay with distance and how the EJ metrics one might use depend on those factors and domain analyzed.

Usage

sim_riskbydistance(
  dist = 1:100,
  ypopdensity.start = 100,
  ypopdensity.end = 50,
  ypopdensity.rate = 0.95,
  ydemog.start = 66,
  ydemog.end = 33,
  ydemog.rate = 0.95,
  yrisk.start = 100,
  yrisk.end = 1,
  yrisk.rate = 0.8,
  silent = FALSE
)

Arguments

dist

Best not to change this. Distances simulated, such as 1 through 100 (that could be kilometers, for example).

ypopdensity.start

population density at closest point to emissions source

ypopdensity.end

at furthest point

ypopdensity.rate

decay rate with distance such as 0.95 for 5 percent drop per 1 of the 100 distance increments

ydemog.start

Demographic group of interest nearby, as percent of pop, 0-100

ydemog.end

at furthest point

ydemog.rate

decay rate with distance such as 0.95 for 5 percent drop per 1 of the 100 distance increments

yrisk.start

Risk metric (e.g., 0 to 100) at nearest point.

yrisk.end

at furthest point

yrisk.rate

decay rate with distance such as 0.95 for 5 percent drop per 1 of the 100 distance increments

silent

whether to print subset of table to console, and suggested plot code

Value

silently returns data.frame of many indicators, at each of the 100 distances

Examples

  x <- sim_riskbydistance()
  plot_3_by_distance(x)
  sim_plotratios(x)

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