# NOT RUN {
data(DMepi)
# Total deaths and person-years in the Danish population
ftable( addmargins( xtabs( cbind( Deaths=D.nD+D.DM,
PYrs=Y.nD+Y.DM ) ~ P + sex,
data=DMepi ),
2 ),
row.vars = 1 )
# Deaths and person-years in the population of diabetes patients
round(
ftable( addmargins( xtabs( cbind( Deaths=D.DM,
PYrs=Y.DM ) ~ P + sex,
data=DMepi ),
2 ),
row.vars = 1 ) )
# }
Run the code above in your browser using DataLab