Learn R Programming

vlad (version 0.2.0)

ell: Estimated log-likelihood.

Description

Estimated log-likelihood.

Usage

ell(s, y, delta)

Arguments

s

Integer vector. Parsonnet Score values within a range of 0 to 100 representing the preoperative patient risk.

y

Double. Binary (0/1) outcome values of each operation.

delta

Double. Box-Cox transformation parameter.

Value

Returns a single value which is estimated log-likelihood.

Examples

Run this code
# NOT RUN {
## load data
data("cardiacsurgery", package = "spcadjust")

## preprocess data to 30 day mortality and subset data to
## phase I (In-control) and phase II (monitoring)
SALL <- cardiacsurgery %>% rename(s = Parsonnet) %>%
  mutate(y = ifelse(status == 1 & time <= 30, 1, 0),
         phase = factor(ifelse(date < 2*365, "I", "II")))

## subset phase I (In-control)
SI <- filter(SALL, phase == "I") %>% select(s, y)

dML <- search_delta(SI$s, SI$y, type = "ML")
ell(SI$s, SI$y, dML)
# }

Run the code above in your browser using DataLab