timeroc_fit {parTimeROC}R Documentation

timeroc_fit

Description

Fit TimeROC using Maximum Likelihood Estimator.

Usage

timeroc_fit(
  obj,
  x,
  t,
  event,
  init.param.x = NULL,
  init.param.t = NULL,
  init.param.copula = NULL,
  init.param.ph = NULL,
  ci = 0.95,
  method = "mle"
)

Arguments

obj

An initialized 'TimeROC' object.

x

A numeric vector of single biomarker or covariate.

t

A numeric vector of time-to-event.

event

A numeric vector of event status (0=dead, 1=alive).

init.param.x

Vector of starting value for biomarker parameter.

init.param.t

Vector of starting value for time-to-event parameter.

init.param.copula

An integer of starting value for copula parameter.

init.param.ph

An integer of starting value for association parameter.

ci

An integer 0 to 1 for confidence level.

method

A string specifying method of estimation. (Default = 'mle')

Value

return a list of frequentist or bayesian estimator.

Examples

## fitting copula model
test <- timeroc_obj(dist = 'gompertz-gompertz-copula', copula = "gumbel90")
set.seed(23456)
rr <- rtimeroc(obj = test, censor.rate = 0, n=500,
               params.t = c(shape=3,rate=1),
               params.x = c(shape=1,rate=2),
               params.copula=-5) # name of parameter must follow standard

plot(t~x, rr)
start.t <- Sys.time()
cc <- timeroc_fit(rr$x, rr$t, rr$event, obj = test)
print(Sys.time()-start.t)

## fitting PH model
test <- timeroc_obj(dist = 'weibull-lognormal-PH')
set.seed(23456)
rr <- rtimeroc(obj = test, censor.rate = 0, n=100,
               params.t = c(meanlog=0, sdlog=1),
               params.x = c(shape=2, scale=1),
               params.ph=0.5) # name of parameter must follow standard
plot(t~x, rr)
start.t <- Sys.time()
cc <- timeroc_fit(rr$x, rr$t, rr$event, obj = test)
print(Sys.time()-start.t)


[Package parTimeROC version 0.1.0 Index]