View source: R/class_newborn_rule.R
| newborn_rule | R Documentation |
Gives, for every state variable of the model, how a newborn's value is
settled: fixed, drawn, or taken from the mother. For fertility().
newborn_rule(...)
from_mother()
... |
One named entry per state variable. |
Each state variable gets it's own argument of the same name:
something every child gets, e.g. parity = "0"
the value is drawn, e.g.
sex = c(male = 0.515, female = 0.485). The probabilities must sum
to one.
from_mother()the child takes the mother's value, e.g.
nat = from_mother(). The mother's value is the one she holds
right after the birth transition.
Drawn variables are drawn independently of one another. When a
probability must depend on an inherited value – e. g. a sex ratio that
differs by nationality – use the table form, new_newborn_rule().
The rule is checked against the model when the subsystem is added. To pass, every state variable needs an entry, and every value must exist.
An object of class micsim_newborn_spec.
fertility(), new_newborn_rule()
newborn_rule(sex = c(male = 0.515, female = 0.485),
nat = from_mother(),
parity = "0")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.