# class of 65 setwd("/Users/jameshanley/Dropbox/Courses/Statistical Models by D Clayton & M Hills/Notes/ch05") ds=read.table("irelandcurrentlifetables.txt", header=TRUE, as.is=TRUE) ds$Age=as.numeric(ds$Age) D=matrix(" -",10,70) I=0 Cohort=1939:1948 for(b.cohort in Cohort) { I=I+1 d=ds[ !is.na(ds$Age) & (ds$Year-ds$Age) == b.cohort & ds$Age > 18 & ds$Age <= 70 ,] Age.upper=max(d$Age,na.rm=TRUE) for(age in 50:Age.upper){ span=19:age S = exp(- ********************* ) # fill in D[I,age] = round(100*(1-S),0) } } str(D) Note1=noquote("Of 100 18 year old Irish males in each birth cohort, one would") Note2=noquote("expect the above numbers to have died by the age indicated.") Note3=noquote("CSO Data end at 2009, but can extrapolate for youngest cohorts") noquote(rbind(rep("",11), c(" ",rep("",4),"Age",rep("",5)), rep("",11), c("",59:68), rep("",11), c("Cohort",rep("",10)), rep("",11), cbind(1939:1948,D[,59:68]))) noquote(rbind(Note1,Note2,Note3))