Doing plot with this data 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

&gt;


I done so but nothing I got

&gt; fit &lt;- survfit(Surv(time) ~ gene, data = km)
&gt; 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


&gt; fit &lt;- coxph(Surv(time) ~ gene, data = km)
&gt; 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")

&gt; 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 &lt;- survfit(Surv(Time, Status) ~ Gene, data = km)


&gt; ggsurvplot(fit, data = km)
Error in data.frame(..., check.names = FALSE) : 
  arguments imply differing number of rows: 70, 0, 140


Any help please?

Thanks
In general, survival analysis can be said to be composed of two steps; Cox regression, with which you calculate the "hazard ratio" based on your variables, and a "Kaplan-Meier (KM) estimate", which is used to visuazlize the data.

Here is a nice tutorial for doing survival analysis with the survival and survminer packages. The latter includes ggplot2 kind visualization of the KM curves.

For the Cox regression, you can use continuous(*) or discrete variables, in your case these would be the normalized expression value of your gene and categories of your gene respectively. You can categorize the expression level of a gene as low vs high, or low vs medium vs high, based on different quantiles.  Another approach to categorize your expression data would be to find an "optimal" cut point with maximally selected rank statistics; from the link: 


  This is an outcome-oriented methods providing a value of a cutpoint
  that correspond to the most significant relation with outcome (here,
  survival)


Basically you search for the cut-point where your data is split into two such that the two resulting parts of the data show the most separation/difference in terms of survival.

* Can a Cox Proportional-Hazards Model be built only with continuous predictors?