Learn R Programming

survutils (version 1.0.2)

get_c_stat: Calculate C-statistics

Description

Wrapper around the Inf.Cval function from the survC1 R package to calculate C-statistics.

Usage

get_c_stat(in.df, endpoint, endpoint.code, prog.factor, tau.val)

Arguments

in.df

data.frame containing all the input data.

endpoint

Column name of endpoint.

endpoint.code

Column name of endpoint code.

prog.factor

Column name of the prognostic factor to test.

tau.val

Vector of tau values to be used for C-statistics inference.

Value

data.frame containing the c-statistic, 95

Examples

Run this code
# NOT RUN {
# Example taken from survC1
# }
# NOT RUN {
library("survival")
in.df <- survC1::CompCase(pbc[1:200, c(2:4,10:14)])
in.df[, 2] <- as.numeric(in.df[,2]==2)
tau <- 365.25*8
prog.factor <- c("trt", "edema", "bili", "chol", "albumin", "copper")
get_c_stat(in.df, "time", "status", prog.factor, tau)
# }

Run the code above in your browser using DataLab