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

Description Usage Arguments Value Note Author(s) See Also Examples

Description

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

Usage

1
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

graph

Note

requires ggplot2

Author(s)

Frans Willekens.

See Also

Lexispoints (requires Epi)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#  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)  
  

Biograph documentation built on May 1, 2019, 8:48 p.m.