R/grow_kid.R
grow_kid.RdFollowing creation of a virtual population using sim_kid(), each virtual
subject grows from their baseline age. It is assumed that each virtual
subject remains at the same respective percentiles of height- and
weight-for-age-and-sex as they were at baseline.For example, if sim_kid()
created a male 2 year old at the 25th percentile of height and the 30th
percentile of weight, then if allowed to grow to 3 years old, this subject
would be at the 25th percentile of height and 30th percentile of weight
for 3 year old males according to the given anthropometric growth chart.
Note that this function will not work for virtual preterm newborns created
using the Fenton growth chart data.
Note that this function will not allow virtual subjects ages 0 to 2 yr to
grow past 2 years.
grow_kid(data = NULL, grow_time = 0, tstep = 1, age0isbirth = FALSE)A data frame created by sim_kid().
A non-negative numeric specifying the duration of time in months the virtual subjects are allowed to grow for. Will be rounded to the nearest month.
A positive numeric specifying the time step for growth in
months. Default of 1. Will be rounded to the nearest month.
Logical TRUE or FALSE matching the sim_kid() input
option used. Default of FALSE.
A data frame with columns matching those of data and the number of
rows equal to nrow(data)*(1+grow_time/tstep)-nsubtract. Where nsubtract
is the number of records with age greater than 240 months.
# growth for 1 year at monthly time step
demo0 <- sim_kid()
demo <- grow_kid(data = demo0, grow_time = 12)