library(survival) surv <- read.table(file = "Lifespan_corr.txt", header = TRUE, dec = ",") surv$small = as.factor(surv$small) surv$ID = as.factor(surv$ID) surv.no20<-subset(surv,surv$treat !=20) surv$treat = as.factor(surv$treat) surv$alive = as.factor(surv$alive) surv$matricide = as.factor(surv$matricide) # remove individuals that remained small throughout the experiment sur = subset(surv, small == "0") ############ # ANALYSES ################################################################## ############ all.matricensored<-coxph(Surv(day,event.m0)~treat*strain,data=surv) all.matricensored anova(all.matricensored) all.matricensored.2<-coxph(Surv(day,event.m0)~treat+strain,data=surv) all.matricensored.2 anova(all.matricensored.2) #Without 20C m.surv.no20<-coxph(Surv(day,event.m0)~treat*strain,data=surv.no20) m.surv.no20 m.surv.no20.2<-coxph(Surv(day,event.m0)~treat+strain,data=surv.no20) m.surv.no20.2