R: Aalen-Johansen nonparametric estimates comparable to a fitted...

ajfit {flexsurv} | R Documentation

## Aalen-Johansen nonparametric estimates comparable to a fitted flexsurvmix model

### Description

Given a fitted flexsurvmix model, return the Aalen-Johansen estimates of the probability of occupying each state at a series of times covering the observed data. State 1 represents not having experienced any of the competing events, while state 2 and any further states correspond to having experienced each of the competing events respectively. These estimates can be compared with the fitted probabilities returned by `p_flexsurvmix` to check the fit of a `flexsurvmix` model.

### Usage

    ajfit(x, newdata = NULL, tidy = TRUE)

### Arguments

`x` | Fitted model returned by `flexsurvmix`.
`newdata` | Data frame of alternative covariate values to check fit for. Only factor covariates are supported.
`tidy` | If `TRUE` then a single tidy data frame is returned. Otherwise the function returns the object returned by `survfit`, or a list of these objects if we are computing subset-specific estimates.

### Details

This is only supported for models with no covariates or models containing only factor covariates.

For models with factor covariates, the Aalen-Johansen estimates are computed for the subsets of the data defined in `newdata`. If `newdata` is not supplied, then this function returns state occupancy probabilities for all possible combinations of the factor levels.

The Aalen-Johansen estimates are computed using `survfit` from the `survival` package (Therneau 2020).

### References

Therneau T (2020). _A Package for Survival Analysis in R_. R package version 3.2-3, <URL: https://CRAN.R-project.org/package=survival>.

[Package flexsurv version 2.1 Index]