predict.wnpmle: Predict marginal mean for new covariate values

View source: R/methods.R

predict.wnpmle_cmprskR Documentation

Predict marginal mean for new covariate values

Description

Evaluates the estimated marginal mean number of recurrent events, \hat\mu(t \mid z) = G\{e^{\hat\beta^T z} \hat\Lambda(t)\}, at new covariate values, with pointwise confidence limits.

Usage

## S3 method for class 'wnpmle_cmprsk'
predict(
  object,
  newdata = NULL,
  times = NULL,
  conf_int = TRUE,
  conf_level = 0.95,
  ...
)

## S3 method for class 'wnpmle'
predict(
  object,
  newdata = NULL,
  times = NULL,
  conf_int = TRUE,
  conf_level = 0.95,
  ...
)

Arguments

object

A wnpmle object.

newdata

A data frame with the same covariates used in fitting (factors may be given as factors or character strings). If NULL, returns the estimated Lambda(t) for the baseline (all covariates = 0).

times

Time points at which to evaluate the marginal mean. If NULL, uses the observed recurrent event times.

conf_int

Logical; if TRUE (default) and standard errors are available, adds pointwise confidence limits.

conf_level

Confidence level (default 0.95).

...

Ignored.

Details

For competing-risks fits (type = "cmprsk"), predict returns the cumulative incidence of the event of interest, \hat F_1(t \mid z) = 1 - \exp[-G\{e^{\hat\beta^T z} \hat\Lambda(t)\}], in columns cif_i; the confidence limits are those of G\{e^{\beta^T z}\Lambda(t)\} (delta method, log scale) mapped through 1 - \exp(-\cdot), so they stay within (0, 1).

The confidence limits are computed with the delta method from the estimated covariance matrix of (\beta, \Lambda) (vcov(object)), on the log scale so that they stay positive.

Value

A data frame with column time and, for each row i of newdata, columns mu_i and (if conf_int) lower_i and upper_i; or columns mu (and lower, upper) for the baseline.


wnpmle documentation built on Dec. 1, 2026, 9:06 a.m.