FitGamma {Temporal}R Documentation

Gamma Distribution Parameter Estimation

Description

Estimates parameters for gamma event times subject to non-informative right censoring. The gamma distribution is parameterized in terms of the shape \alpha and rate \lambda:

f(t) = \frac{\lambda}{\Gamma(\alpha)}(\lambda t)^{\alpha-1}e^{-\lambda t}, t>0

Usage

FitGamma(
  data,
  eps = 1e-06,
  init = list(),
  maxit = 10,
  report = FALSE,
  sig = 0.05,
  status_name = "status",
  tau = NULL,
  time_name = "time"
)

Arguments

data

Data.frame.

eps

Tolerance for Newton-Raphson iterations.

init

List with initial values for the 'shape' \alpha and 'rate' \lambda.

maxit

Maximum number of NR iterations.

report

Report fitting progress?

sig

Significance level, for CIs.

status_name

Name of the status indicator, 1 if observed, 0 if censored.

tau

Optional truncation times for calculating RMSTs.

time_name

Name of column containing the time to event.

Value

An object of class fit containing the following:

Parameters

The estimated shape \alpha and rate \lambda.

Information

The observed information matrix.

Outcome

The fitted mean, median, and variance.

RMST

The estimated RMSTs, if tau was specified.

Examples

# Generate Gamma data with 20% censoring.
data <- GenData(n = 1e3, dist = "gamma", theta = c(2, 2), p = 0.2)

# Estimate parameters.
fit <- FitParaSurv(data, dist = "gamma")

[Package Temporal version 0.3.0.1 Index]