I'm trying to use the survival package in R to run a log rank test on median survival rates - is that possible? I'm using the code:
survdiff(surv(Age, Survival) ~ Treatment, data = GBM)
where Age = age at diagnosis; Survival = is how many years they survived; Treatment = is whether they received treatment (coded as 1 or 2)
If this is right, why am I getting the error:
Error in survdiff.fit(y, groups, strata.keep, rho) :
There is only 1 group
In addition: Warning message:
In Surv(GBM$Age, GBM$Survival) : Invalid status value, converted to NA
Does Treatment need to coded as 0 or 1 instead of 1 or 2?