JS.uni_fdr: A complete table for univariable survival analysis (C index,...

Description Usage Arguments Value Examples

Description

JS.uni output the table with general multivariable survival analysis result with Number of total patients, Number of Events, HR (95% Confidence Interval),P value, C index and D index. This function only change the format of the output table. Note: c index and d index are from package survcomp.

Usage

1
2
JS.uni_fdr(Data, Event, Stime, Svar, groupn, Cat = F, cindex = F,
  dindex = F, AIC = F)

Arguments

Event

The status indicator, normally 0=alive, 1=dead

Stime

This is the follow up time

Svar

A vector of group

groupn

A text vector of the the group name for output

Cat

logical, indicating whether or not Svar is a categorical varaible

cindex

logical, indicating whether or not cindex should be in the table

dindex

logical, indicating whether or not dindex should be in the table

AIC

logical, indicating whether or not AIC should be in the table

D

A data.frame in which to interpret the variables

Value

A dataframe of coxph output including Number of total patients, Number of Events, HRs (95% Confidence Intervals), P values, C index and D index.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
JS.uni_fdr(D = D ,"pd_censor", "pd_surv" , "tr_group", "Treatment" , Cat = T , cindex = F, dindex = F, AIC = F)

rtf output
rtf<-RTF("Table_survival.doc",width = 8.5, height = 11, font.size = 10, omi = c(1,1,1,1))
addHeader(rtf,title="Table , Survival Analysis  ")
addTable(rtf,isup_m.surv, font.size = 10, row.names = F, NA.string="-", col.widths = c(rep(0.6, 3), 2, rep(0.6, 3) ) )
done(rtf))

Rmarkdown output
save(isup_m.surv, file='myfile.Rda')

Then open at markdown file
library(knitr)
load("H:/Projects/myfile.Rda")
"```{r, echo=FALSE,results = 'asis'}"
output <- load("H:/Projects/p_Smith, Mitchell/Rituxan/Rituxan/T_BMI.Rdata")
knitr::kable(isup_m.surv, format = "markdown")  

SophiaJia/Jsurvformat documentation built on May 9, 2019, 1:52 p.m.