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

phfunc

Loglihood function of a proportional hazards regression


Description

Calculates minus the log likelihood function and its first and second order derivatives for data from a Weibull regression model.

Usage

phfunc(
  beta = NULL,
  lambda,
  p,
  X = NULL,
  Y,
  offset = rep(0, length(Y)),
  ord = 2,
  pfixed = FALSE,
  dist = "weibull"
)

Arguments

beta

Regression parameters

lambda

The scale paramater

p

The shape parameter

X

The design (covariate) matrix.

Y

The response, a survival object.

offset

Offset.

ord

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

pfixed

Logical, if TRUE the shape parameter is regarded as a known constant in the calculations, meaning that it is not cosidered in the partial derivatives.

dist

Which distribtion? The default is "weibull", with the alternatives "loglogistic" and "lognormal".

Details

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

S(t; p, lambda, beta, z) = S_0((t / lambda)^p)^exp(z beta)

Value

A list with components

f

The log likelihood. Present if ord >= 0

fp

The score vector. Present if ord >= 1

fpp

The negative of the hessian. Present 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.