Learn R Programming

mets (version 1.3.11)

interval_logitsurv_discrete: Discrete Time-to-Event Analysis with Interval Censoring

Description

Fits a cumulative odds model for discrete time-to-event data, handling interval censoring where the event time is known only to lie within an interval \((t_l, t_r]\). The model assumes: $$ \text{logit}(P(T \leq t | x)) = \log(G(t)) + x \beta $$ where \(G(t)\) is the baseline cumulative odds function and \(\beta\) are the regression coefficients. This is equivalent to: $$ P(T \leq t | x) = \frac{G(t) \exp(x \beta)}{1 + G(t) \exp(x \beta)} $$

Usage

interval_logitsurv_discrete(
  formula,
  data,
  beta = NULL,
  no.opt = FALSE,
  method = "NR",
  stderr = TRUE,
  weights = NULL,
  offsets = NULL,
  exp.link = 1,
  increment = 1,
  ...
)

Value

An object of class "cumoddsreg" containing:

coef

Estimated coefficients (baseline time effects and covariate effects).

se.coef

Standard errors of the coefficients.

var

Variance-covariance matrix.

iid

Influence function (IID) decomposition for robust variance estimation.

ntimes

Number of distinct time intervals.

utimes

Unique time points.

ploglik

Log-likelihood at convergence.

gradient, hessian

Optimization results.

call

Original function call.

Arguments

formula

Formula with an Interval object (e.g., Interval(entry, time)) on the left-hand side and covariates on the right. Can include cluster() for correlated data.

data

Data frame containing the variables in the formula.

beta

Starting values for the optimization (vector of length \(p + k\), where \(p\) is the number of covariates and \(k\) is the number of time intervals).

no.opt

Logical; if TRUE, skips optimization and returns estimates based on the provided beta (useful for initialization).

method

Optimization method: "NR" (Newton-Raphson, default) or "nlm".

stderr

Logical; if FALSE, returns only the coefficient estimates.

weights

Observation weights (follows ID).

offsets

Offsets (follows ID).

exp.link

Logical; if TRUE, parameterizes increments as \(\exp(\alpha) > 0\).

increment

Logical; if TRUE, uses increments \(dG(t) = \exp(\alpha)\) as parameters.

...

Additional arguments passed to the optimizer (lava::NR or nlm).

Author

Thomas Scheike

Details

The baseline \(G(t)\) is parameterized as the cumulative sum of exponentials (\(G(t) = \sum \exp(\alpha)\)), ensuring positivity. The regression coefficients describe the log-odds of the event occurring by time \(t\).

The likelihood is maximized over the observed intervals: $$ L = \prod_i [ P(T_i > t_{il} | x_i) - P(T_i > t_{ir} | x_i) ] $$ where \(t_{il}\) and \(t_{ir}\) are the left and right endpoints of the interval for subject \(i\). Right-censored intervals have \(t_{ir} = \infty\).

References

Scheike, T. H. (2024). Discrete time survival analysis with interval censoring. mets package documentation.

See Also

cumoddsreg, predictlogitSurvd, simlogitSurvd

Examples

Run this code
data(ttpd) 
dtable(ttpd,~entry+time2)

out <- interval_logitsurv_discrete(Interval(entry,time2)~X1+X2+X3+X4,ttpd)
summary(out)
head(iid(out)) 

pred <- predictlogitSurvd(out,se=FALSE)
plotSurvd(pred)

ttpd <- dfactor(ttpd,fentry~entry)
out <- cumoddsreg(fentry~X1+X2+X3+X4,ttpd)
summary(out)

Run the code above in your browser using DataLab