Description Usage Arguments Details Value Author(s) See Also
Assigns demographic and physiological variables to each theoretical person to be modeled.
1 | select.people(n, pop, py, act.p, diet.p, act.d, diet.d, specs)
|
n |
Number of persons. |
pop |
The population input; output of |
py |
Regression parameters on the three physiological variables of interest (weight, height, and body mass index) for
various age and gender groups. Output of the |
act.p |
Activity diary pools; output of the |
diet.p |
Dietary diary pools; output of the |
act.d |
Activity diaries, which indicate the amount of time and level of metabolic activity in various 'micros'.
Each line of data represents one person-day (24 hours). Output of the |
diet.d |
Daily diaries of dietary consumption by food group; output of the |
specs |
Output of the |
This is the first real step in the modeling process. It first fills an array q
with uniform random numbers,
with ten columns because there are 10 random variables defined by this function. There number of rows correspond to the number
of persons, capped at the set.size
specified in the Run
input file (typically 5000). Gender is selected
from a discrete (binomial) distribution where the counts of males and females in the study age range determines the gender
probabilities. Age is tabulated next, separately for each gender. The counts by year of age are chosen for the appropriate
gender and used as selection weights. Season is assigned randomly (equal weights) using those specified in the Run
input file. Weekend
is set to one or zero, with a chance of 2/7 for the former.
The next block of code assigns physiological variables. Weight is lognormal in SHEDS, so a normal is sampled first and then
exp()
is applied. This means that the weight parameters refer to the properties of log(weight), which were fit by
linear regression. The basal metabolic rate (bmr), is calculated by regression. A minimum bmr is set to prevent extreme cases
from becoming zero or negative. The alveolar breathing ventilation rate corresponding to bmr is also calculated. The SHEDS
logic sets activities in each micro to be a multiple of these rates, with outdoor rates higher than indoor, and indoor rates
higher than sleep rates. This calculated activities affect the inhaled dose. The skin surface area is calculated using
regressions based on height and weight for 3 age ranges.
The next step is to assign diaries. Here, a FOR loop over n persons (n rows) is used to assign appropriate diet and activity
diary pools to each person. An empirical distribution is created, consisting of the list of diary numbers for each pool.
The final step is to retrieve the actual data from the chosen activity and diet diaries, and the result becomes pd
.
pd A dataframe of "person-demographics": assigned demographic and physiological parameters for each theoretical person modeled in SHEDS.HT
Kristin Isaacs, Graham Glen
run
, read.pop.file
, read.phys.file
, act.diary.pools
, diet.diary.pools
, read.act.diaries
, read.diet.diaries
, update.specs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.