问题
I am trying to run a survival analysis on a set of data I have collected. In this data frame (m3), each row is a new patient and each column is a mutation I have identified. I have made a binary data table to indicate whether each patient is positive or negative for the mutation. I can run a survfit function for each column(mutation), but I have hundreds and want to loop through them. I have written the following code, but don't think it is correct (nothing is being output).
for (i in m3[,2:256]) {survdiff(Surv(m3$Overall.Survival, m3$Status) ~ i,
data = m3)}
Once I gather this data I want to make a table with each mutation (column) as a row and put the p-value from this survfit object as the column.
I'm not sure why I don't have any output for the for loop and even more so how to generate the new data frame. I believe I would be subsetting it.
来源:https://stackoverflow.com/questions/48726437/survdiff-p-value-comparison