Learn R Programming

Biograph (version 2.0.6)

Lexis.points: Plots ages and calendar years at transitions in Lexis diagram

Description

Plots observations in age-time diagram for each category of categorical covariate (using ggplot2)

Usage

Lexis.points(Bdata, transition, title, cov,group,legend.pos,pdf)

Arguments

Bdata
Biograph object
transition
The transition selected, e.g. "NJ" in GLHS data
title
Title of Lexis diagram
cov
Covariate. Observations are plotted for each category of this covariate. If observations should be plotted for the total sample population, cov = NA
group
Covariate. Graphs for groups are in separate panels.
legend.pos
position of legend
pdf
If graph should be stored in pdf file: pdf=TRUE, else pdf=FALSE

Value

See Also

Lexispoints (requires Epi)

Examples

Run this code
#  Example 1: ages at labour market entry, by sex
  data(GLHS)
  #y <- Parameters(GLHS)
  t <- "Date and age at labour market entry by sex and cohort"
  z <- Lexis.points (GLHS,"NJ",title=t,cov="sex",group="cohort",legend.pos="right",pdf=FALSE)

#  Example 2: ages at first birth among married women, by religious denomination
  data(NLOG98)
  y <- Parameters (NLOG98)
  t <- "Date and age at first birth (married women) by religion and cohort"
  z <- Lexis.points (NLOG98,"MK",title=t,cov="kerk",group="cohort",legend.pos="right",pdf=FALSE)
#  Example 3: ages at leaving home, by birth cohort (any destination)
  t <- "Date and age at leaving parental home by religion and education"
  z <- c(0.7,0.2)
  z <- Lexis.points (NLOG98,"H*",title=t,cov="kerk",group="educ",legend.pos=z,pdf=FALSE)  
  

Run the code above in your browser using DataLab