Skip to contents

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 x to function simulate_age. After simulating ages, the inhalation rate is subsequently calculated using simulate_inhalation_rate.

obesity

input x to function simulate_obesity.

exposure

input x to function simulate_exposure.

simulated_css

input simulated_css to functions sample_Css and get_fixed_css.

...

additional arguments passed to other functions. See details.

Value

The same object with simulated fields added.

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.

Examples

# For information about geo_tox_data, see:
# vignette("package_data", package = "GeoTox")

geoTox <- GeoTox() |> 
  simulate_population(age = split(geo_tox_data$age, ~FIPS)[1:5],
                      obesity = geo_tox_data$obesity[1:5, ],
                      exposure = split(geo_tox_data$exposure, ~FIPS)[1:5],
                      simulated_css = geo_tox_data$simulated_css,
                      n = 10)