httkpop_direct_resample_inner: Inner loop function called by 'httkpop_direct_resample'.

View source: R/httkpop_direct_resample_inner.R

httkpop_direct_resample_innerR Documentation

Inner loop function called by httkpop_direct_resample.

Description

Inner loop function called by httkpop_direct_resample.

Usage

httkpop_direct_resample_inner(
  nsamp,
  gendernum,
  agelim_months,
  agelim_years,
  reths,
  weight_category,
  gfr_resid_var,
  ckd_epi_race_coeff,
  nhanes_mec_svy
)

Arguments

nsamp

The desired number of individuals in the virtual population. nsamp need not be provided if gendernum is provided.

gendernum

Optional: A named list giving the numbers of male and female individuals to include in the population, e.g. list(Male=100, Female=100). Default is NULL, meaning both males and females are included, in their proportions in the NHANES data. If both nsamp and gendernum are provided, they must agree (i.e., nsamp must be the sum of gendernum).

agelim_months

Optional: A two-element numeric vector giving the minimum and maximum ages (in months) to include in the population. Default is c(0, 959), equivalent to the default agelim_years. If agelim_months is provided and agelim_years is not, agelim_months will override the default values of agelim_years.

agelim_years

Optional: A two-element numeric vector giving the minimum and maximum ages (in years) to include in the population. Default is c(0,79). If agelim_years is provided and agelim_months is not, agelim_years will override the default value of agelim_months.

reths

Optional: a character vector giving the races/ethnicities to include in the population. Default is c('Mexican American','Other Hispanic','Non-Hispanic White','Non-Hispanic Black','Other'), to include all races and ethnicities in their proportions in the NHANES data. User-supplied vector must contain one or more of these strings.

weight_category

Optional: The weight categories to include in the population. Default is c('Underweight', 'Normal', 'Overweight', 'Obese'). User-supplied vector must contain one or more of these strings.

gfr_resid_var

Logical value indicating whether or not to include residual variability when generating GFR values. (Default is TRUE, passed from 'httkpop_direct_resample'.)

ckd_epi_race_coeff

Logical value indicating whether or not to use the "race coefficient" from the CKD-EPI equation when estimating GFR values. (Default is FALSE, passed from 'httkpop_direct_resample'.)

nhanes_mec_svy

surveydesign object created from mecdt using svydesign (this is done in httkpop_generate)

Value

A data.table where each row represents an individual, and each column represents a demographic, anthropometric, or physiological parameter.

Author(s)

Caroline Ring

References

Ring, Caroline L., et al. "Identifying populations sensitive to environmental chemicals by simulating toxicokinetic variability." Environment International 106 (2017): 105-118


httk documentation built on March 7, 2023, 7:26 p.m.