coef.coxkl: Extract Coefficients from a 'coxkl' Object

View source: R/coef.R

coef.coxklR Documentation

Extract Coefficients from a coxkl Object

Description

Extracts the estimated regression coefficients (beta) from a fitted coxkl object. Optionally, a value (or vector) of eta can be supplied. If the requested eta values are not in the fitted sequence, linear interpolation is performed between the nearest neighboring eta values; out-of-range requests error.

Usage

## S3 method for class 'coxkl'
coef(object, eta = NULL, ...)

Arguments

object

An object of class "coxkl", typically the result of coxkl.

eta

Optional numeric value or vector specifying the \eta values for which to extract (or interpolate) coefficients. If NULL, all estimated coefficients are returned.

...

Additional arguments (currently ignored).

Value

A numeric matrix of regression coefficients. Each column corresponds to one value of eta, sorted in ascending order.

Examples

data(ExampleData_lowdim)

train_dat_lowdim <- ExampleData_lowdim$train
beta_external_good_lowdim <- ExampleData_lowdim$beta_external_good
eta_list <- generate_eta(method = "exponential", n = 5, max_eta = 5)

model <- coxkl(z = train_dat_lowdim$z,
               delta = train_dat_lowdim$status,
               time = train_dat_lowdim$time,
               stratum = train_dat_lowdim$stratum,
               beta = beta_external_good_lowdim,
               etas = eta_list)
coef(model)


survkl documentation built on April 22, 2026, 1:08 a.m.