getLogLikelihood: Get Log-Pseudo Likeihood

Description Usage Arguments Value References Examples

Description

Returns log-pseudo likeihood at a specific value of beta.

Usage

1
2
getLogLikelihood(ftime, fstatus, X, failcode = 1, cencode = 0,
  beta = rep(0, dim(X)[2]))

Arguments

ftime

A vector of event/censoring times.

fstatus

A vector with unique code for each event type and a separate code for censored observations.

X

A matrix of fixed covariates (nobs x ncovs)

failcode

Integer: code of fstatus that event type of interest (default is 1)

cencode

Integer: code of fstatus that denotes censored observations (default is 0)

beta

A vector of coefficient values at which to evaluate log-pseudo likelihood

Value

Returns log-pseudo likelihood at beta.

References

Fine J. and Gray R. (1999) A proportional hazards model for the subdistribution of a competing risk. JASA 94:496-509.

Examples

1
2
3
4
5
6
7
8
9
library(cmprsk)
set.seed(10)
ftime <- rexp(200)
fstatus <- sample(0:2, 200, replace = TRUE)
cov <- matrix(runif(1000), nrow = 200)
dimnames(cov)[[2]] <- c('x1','x2','x3','x4','x5')
fit <- crr(ftime, fstatus, cov)
fit$loglik
getLogLikelihood(ftime, fstatus, cov, beta = fit$coef)

erickawaguchi/crrBAR documentation built on June 6, 2019, 7:56 a.m.