Learn R Programming

bayesPop (version 10.0-1)

mac.expression: Expression Generator

Description

Help functions to easily generate commonly used expressions.

Usage

mac.expression(country)
mac.expression1(country)
mac.expression5(country)

Value

mac.expression returns a character string corresponding to the formula \((17.5*R_c(15-19) + 22.5*R_c(20-24) + ... + 47.5*R_c(45-49))/100\)

where \(R_c(x)\) denotes the country-specific percent age-specific fertility for the age group \(x\).

mac.expression1 returns a character string corresponding to the formula \((10.5*R_c(10-11) + 11.5*R_c(11-12) + ... + 54.5*R_c(54-55))/100\)

Arguments

country

Country code as defined for expressions.

Details

mac.expression and mac.expression1 generate expressions for the mean age of childbearing of the given country, for 5-year age groups and 1-year age groups, respectively. mac.expression5 is a synonym for mac.expression. Note that pop.predict has to be run with keep.vital.events=TRUE for this to work.

See Also

pop.expressions

Examples

Run this code
if (FALSE) {
sim.dir <- tempfile()
# Run pop.predict with storing vital events
pred <- pop.predict(countries=c("Germany", "France"), nr.traj=3, 
           keep.vital.events=TRUE, output.dir=sim.dir)
# plot the mean age of childbearing 
pop.trajectories.plot(pred, expression=mac.expression("FR"), cex.main = 0.7)
unlink(sim.dir, recursive=TRUE)}

Run the code above in your browser using DataLab