Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

coxfunk

Loglihood function (partial likelihood) of a Cox regression


Description

Calculates minus the log likelihood function and its first and second order derivatives for data from a Cox regression model. It is used by coxreg if the argument coxph = FALSE

Usage

coxfunk(beta, X, offset, rs, what = 2)

Arguments

beta

Regression parameters

X

The design (covariate) matrix.

offset

Offset.

rs

Risk set created by risksets(..., collate_sets = TRUE)

what

what = 0 means only loglihood, 1 means score vector as well, 2 loglihood, score and hessian.

Details

Note that the function returns log likelihood, score vector and minus hessian, i.e. the observed information. The model is

Value

A list with components

loglik

The log likelihood.

dloglik

The score vector. Nonzero if what >= 1

d2loglik

The hessian. Nonzero if ord >= 2

Author(s)

Göran Broström

See Also


eha

Event History Analysis

v2.10.0
GPL (>= 2)
Authors
Göran Broström [aut, cre], Jianming Jin [ctb]
Initial release
2022-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.