% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/recreg.R
\name{recregIPCW}
\alias{recregIPCW}
\title{IPCW Estimator for Recurrent Events}
\usage{
recregIPCW(
  formula,
  data = data,
  cause = 1,
  cens.code = 0,
  death.code = 2,
  cens.model = ~1,
  km = TRUE,
  times = NULL,
  beta = NULL,
  offset = NULL,
  type = c("II", "I"),
  marks = NULL,
  weights = NULL,
  model = c("exp", "lin"),
  no.opt = FALSE,
  augmentation = NULL,
  method = "nr",
  se = TRUE,
  ...
)
}
\arguments{
\item{formula}{Formula with an 'Event' outcome.}

\item{data}{Data frame.}

\item{cause}{Cause of interest (default is 1).}

\item{cens.code}{Censoring code (default is 0).}

\item{death.code}{Death code (default is 2).}

\item{cens.model}{Formula for the censoring model (default is \code{~1}).}

\item{km}{Logical; if \code{TRUE}, uses Kaplan-Meier for censoring weights; otherwise uses Cox model.}

\item{times}{Time points for estimation (required).}

\item{beta}{Initial values for coefficients (optional).}

\item{offset}{Offsets.}

\item{type}{Type of estimator: \code{"II"} (default) or \code{"I"}.}

\item{marks}{Mark values.}

\item{weights}{Weights.}

\item{model}{Model type for the mean: \code{"exp"} (default) or \code{"lin"}.}

\item{no.opt}{Logical; if \code{TRUE}, skips optimization.}

\item{augmentation}{Augmentation terms.}

\item{method}{Optimization method (default is "nr").}

\item{se}{Logical; if \code{TRUE}, computes standard errors.}

\item{...}{Additional arguments.}
}
\value{
An object of class \code{"binreg"} (extending \code{"resmean"}) containing:
\item{coef}{Estimated coefficients.}
\item{var}{Variance-covariance matrix.}
\item{iid}{Influence functions.}
\item{times}{Time points.}
\item{Y}{Observed IPCW weighted counts (increment IPCW) \deqn{\int_0^t (1/G_c(s)) dN(s)}.}
}
\description{
Computes the Inverse Probability of Censoring Weighted (IPCW) estimator for the mean number of recurrent events.
Supports various estimators including the Ghosh-Lin and Lawless-Cook estimators.
}
\seealso{
\code{\link{recreg}}
}
\author{
Thomas Scheike
}
