View source: R/create_time_svhm.R
create_time_svhm | R Documentation |
Calculates the Risk score and the value of the prediction function for each individual in the data set.
create_time_svhm( df, covariates, cost, varName_cencored, varName_futime, start_interval, end_interval, test_size = 0.3, opt = "osqp", gamma_squared = 0.5 )
df |
data frame |
covariates |
vector of name of covariates |
cost |
cost parameter to be used |
varName_cencored |
name of variable in df that indicates cencoring |
varName_futime |
name of variable in df that indicates event time |
start_interval |
name of variable that indicates when the interval starts |
end_interval |
name of variable that indicates when the interval ends |
test_size |
size of final test set in precent |
opt |
which quadratic optimization is used ( |
gamma_squared |
width of gaussian kernel |
trained model with
$e_vec
vector indicating if an event happens at each event time
$sol
calculated optimal solution for each event time
$train
train dataset with risk scores
$test
test dataset with risk scores
cost
cost parameter
In contrast to the create_svhm()
function this function does not predict event times!
{ library(timereg) library(SVHM) ############## # Parameters # ############## opt <- "osqp" gamma_squared <- 200 test_size=.3 cost <- 16 ###################### # Model prediction # ###################### data(csl) time_model <- create_time_svhm(csl, c("sex", "age"), cost, varName_cencored='dc', varName_futime='eventT', start_interval='lt, end_interval='rt, test_size=test_size, opt=opt, gamma_squared=gamma_squared) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.