biostatistics and epidemiology with R
Sunday, March 4, 2012
Estimating Cox Model parameters with and without coxph function from survival package
Reading data
library(survival)
data(veteran)
time.var <- veteran[,3]
status.var <- veteran[,4]
covariate.matrix <- veteran[,c(1,5:8)]
covariate.names <- names(veteran[,c(1,5:8)])
data <- cbind.data.frame(time.var,status.var,covariate.matrix)
Read more »
Kaplan-Meier and Nelson-Aalen estimates with and without survfit function from survival package
Data reading:
rm(list=ls(all=TRUE)) # wipe out everything else
require(survival)
data = aml[aml$x == "Maintained",]
data
Read more »
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)