simulate_population {GeoTox} | R Documentation |
Simulate population data
Description
Simulate population data for given input fields
Usage
simulate_population(
x,
age = NULL,
obesity = NULL,
exposure = NULL,
simulated_css = NULL,
...
)
Arguments
x |
GeoTox object. |
age |
input |
obesity |
input |
exposure |
input |
simulated_css |
input |
... |
additional arguments passed to other functions. See details. |
Details
Additional parameters include n
for sample size,
IR_params
for simulate_inhalation_rate,
obes_prev
, obes_sd
, and obes_label
for simulate_obesity,
and expos_mean
, expos_sd
, and expos_label
for simulate_exposure.
Value
The same object with simulated fields added.
Examples
# Use a subset of the package data for demonstration purposes
set.seed(2357)
n <- 10 # Population size
m <- 5 # Number of regions
idx <- if (m < 100) sample(1:100, m) else 1:100
# Create GeoTox object
geoTox <- GeoTox() |>
# Simulate populations for each region
simulate_population(age = split(geo_tox_data$age, ~FIPS)[idx],
obesity = geo_tox_data$obesity[idx, ],
exposure = split(geo_tox_data$exposure, ~FIPS)[idx],
simulated_css = geo_tox_data$simulated_css,
n = n)
[Package GeoTox version 0.2.0 Index]