R/cif-stat-arguments.R

#' These arguments are shared by [cifplot()], [cifpanel()], and [cifcurve()].
#'
#' @name cif-stat-arguments
#' @keywords internal
#'
#' @param data A data frame containing variables in the formula.
#' @param weights Optional name of the weight variable in `data`. Weights must be nonnegative.
#' @param n.risk.type Character string; one of `"weighted"`, `"unweighted"`, or `"ess"`.
#' Controls which risk set size is returned in `$n.risk` without affecting estimates or SEs (default `"weighted"`).
#' @param subset.condition Optional character string giving a logical condition to subset
#' `data` (default `NULL`).
#' @param na.action A function specifying the action to take on missing values (default `na.omit`).
#' @param outcome.type Character string specifying the type of time-to-event outcome.
#' One of `"survival"` (Kaplan-Meier) or `"competing-risk"` (Aalen-Johansen).
#' If `NULL` (default), the function automatically infers the outcome type from the data:
#' if the event variable has more than two unique levels, `"competing-risk"` is assumed;
#' otherwise, `"survival"` is used. You can also use abbreviations such as `"S"` or `"C"`.
#' An explicit `"competing-risk"` remains in effect when a cause is absent in the analysis data.
#' Mixed or ambiguous inputs (e.g., `c("S", "C")`) trigger automatic detection based on the event coding.
#' @param code.event1 Integer code of the event of interest (default `1`).
#' @param code.event2 Integer code of the competing risk (default `2`).
#' @param code.censoring Integer code of censoring (default `0`).
#' @param error Character string specifying the method for SEs and CIs used internally.
#' For `"survival"` without weights, choose one of `"greenwood"` (default), `"tsiatis"`, `"if"`, or `"fay"`.
#' For `"competing-risk"` without weights, choose one of `"delta"` (default), `"aalen"`, `"if"`, or `"fay"`.
#' Weighted analysis defaults to influence-function SEs (`"if"`). The C++ curve
#' engine also supports `"fay"`, a Fay--Graubard-type correction. Supplied weights
#' are held fixed; uncertainty from estimating a propensity score is not included.
#' @param conf.type Character specifying the method of transformation for CIs
#' used internally (default `arcsine-square root`).
#' @param conf.int Numeric two-sided level of CIs (default `0.95`).
#'
NULL

Try the cifmodeling package in your browser

Any scripts or data that you put into this service are public.

cifmodeling documentation built on Nov. 11, 2026, 9:06 a.m.