################################################### ### chunk number 1: ################################################### library(Epi) ################################################### ### chunk number 2: ################################################### # Enter the data from the table into a matrix D <- matrix( c(2900,120,50,45,40,500,130,60,55,40), 5, 2 ) D ################################################### ### chunk number 3: LD1 ################################################### # Make a Lexis diagram and represent the numbers there par( mar=c(3,3,1,1), mgp=c(3,1,0)/1.6 ) Lexis.diagram( age=c(0,5), date=c(1991,1996), int=1, lab.int=1,coh.grid=T ) box() text( 1994+rep( c(2,4)/3, c(5,5) ), c(0:4+1/3,0:4+2/3), paste( D ) ) ################################################### ### chunk number 4: ################################################### # Enter the information in two data structures B <- c(142,138)*1000 D <- c(2900,500,2600,450) ################################################### ### chunk number 5: LD2 ################################################### # Make a Lexis diagram and represent the numbers there par( mar=c(3,3,1,1), mgp=c(3,1,0)/1.6 ) Lexis.diagram( age=c(0,5), date=c(1991,1996), int=1, lab.int=1, coh.grid=T ) text( 1991+c(2,4,5,7)/3, c(1,2,1,2)/3, paste( D ) ) text( 1991.5+0:1, 0, paste( B ), adj=c(0.5,-0.2),col="red" )