I have normalized expression values of some genes in some patients and the how many days they have survived from their diagnosis with cancer like below
EDITED
I have taken mean of the expression values for each patient and I have how many days each patient survived since diagnosis as below
>
I done so but nothing I got
> fit <- survfit(Surv(time) ~ gene, data = km)
> print(fit)
Call: survfit(formula = Surv(time) ~ gene, data = km)
n events median 0.95LCL 0.95UCL
gene=-0.333140816 1 1 859 NA NA
gene=-0.307846735 1 1 347 NA NA
gene=-0.303559694 1 1 1339 NA NA
gene=-0.290518776 1 1 61 NA NA
The question is if these genes increase survival time or not but likely I am doing wrong
By your help
> fit <- coxph(Surv(time) ~ gene, data = km)
> print(fit)
Call:
coxph(formula = Surv(time) ~ gene, data = km)
coef exp(coef) se(coef) z p
gene 0.8664 2.3783 1.4520 0.597 0.551
Likelihood ratio test=0.35 on 1 df, p=0.5543
n= 69, number of events= 69
For plotting I guess I do need another information because
library("survminer")
> ggsurvplot(fit, data = km)
Error in ggsurvplot(fit, data = a) : object 'ggsurv' not found
EDITED
I divided patients based on the median of survival days to Up and Down category like below but still I am failing to visualize that
fit <- survfit(Surv(Time, Status) ~ Gene, data = km)
> ggsurvplot(fit, data = km)
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 70, 0, 140
Any help please?
Thanks