This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to compute a one tail (one way) log rank test for survival?

I have censored survival data. I have been using a log rank test to get a p-value for overall survival. For example in R I have been using the survdiff function from the survival package and the below chisq test to find a survival pvalue. However this gives you the 2 tail test p value. I am only interested in one direction, For example do the patients with some mutation have better survival. My hypothesis is such that I am not interested in the other direction. Chisq being a goodness of fit measure captures both directions. What would be the equivalent code or reasoning to capture the one way or one tail logrank p value?

Thanks

input<-as.formula(paste0("Surv(survival_time,censoring_status) ~ ",gene_name))
gene.survival <-survdiff(input,data=data)
p.val <-  1 - pchisq(gene.survival$chisq, length(gene.survival$n) - 1)

one-way one way one-tailed one tail log-rank

r survival hypothesis-testing log-rank

1 answer

Hello, it has been 7 years since denalitastic posted this question. I come into the same question right now and here is the solution i find: https://github.com/gpaux/Mediana/blob/e3a7d7f49292f1f3e4b91e831d957353b798df36/R/LogrankTest.R#L6 It seems that we can use hazard ratio to decide whether the test is on the "way", or, "direction" we want. If the test is on the dection we want, the p value for one sided test is just half of the p value that survdiff provides, and if not the direction we want, the p value is just 1. Yet I think if not the direction we want, the p value should be 1 minus the half of the p value.

Log in to answer this question.