1\name{occup}
2\alias{occup}
3\docType{data}
4\title{ A small occupational cohort }
5\description{This is the data that is behind the illustrative Lexis
6diagram in Breslow & Day's book on case-control studies.}
7\usage{data(occup)}
8\format{
9  A data frame with 13 observations on the following 4 variables.
10  \describe{
11    \item{\code{AoE}}{a numeric vector, Age at Entry}
12    \item{\code{DoE}}{a numeric vector, Date of entry}
13    \item{\code{DoX}}{a numeric vector, Date of eXit}
14    \item{\code{Xst}}{eXit status \code{D}-event, \code{W}-withdrawal,
15                     \code{X}-censoring}
16  }
17}
18\references{
19Breslow & Day: Statistical Methods in Cancer Research, vol 1:
20The analysis of case-control studies, figure 2.2, p. 48.}
21\examples{
22data(occup)
23lx <- Lexis( entry = list( per=DoE, age=AoE ),
24              exit = list( per=DoX ),
25      entry.status = "W",
26       exit.status = Xst,
27              data = occup )
28plot( lx )
29# Split follow-up in 5-year classes
30sx <- splitLexis( lx, seq(1940,1960,5), "per" )
31sx <- splitLexis( sx, seq(  40,  60,5), "age" )
32plot( sx )
33
34# Plot with a bit more paraphernalia and a device to get
35# the years on the same physical scale on both axes
36ypi <- 2.5 # Years per inch
37dev.new( height=15/ypi+1, width=20/ypi+1 ) # add an inch in each direction for
38par( mai=c(3,3,1,1)/4, mgp=c(3,1,0)/1.6 )  # the margins set in inches by mai=
39plot(sx,las=1,col="black",lty.grid=1,lwd=2,type="l",
40     xlim=c(1940,1960),ylim=c(40,55),xaxs="i",yaxs="i",yaxt="n",
41     xlab="Calendar year", ylab="Age (years)")
42axis( side=2, at=seq(40,55,5), las=1 )
43points(sx,pch=c(NA,16)[(sx$lex.Xst=="D")+1] )
44box()
45# Annotation with the person-years
46PY.ann.Lexis( sx, cex=0.8 )
47}
48\keyword{datasets}
49