FitParaSurv | R Documentation |
Estimates parametric survival distributions using event times subject to non-informative right censoring. Available distributions include: exponential, gamma, generalized gamma, log-normal, and Weibull.
FitParaSurv(
data,
beta_lower = 0.1,
beta_upper = 10,
dist = "weibull",
eps = 1e-06,
init = NULL,
maxit = 10,
report = FALSE,
sig = 0.05,
status_name = "status",
tau = NULL,
time_name = "time"
)
data |
Data.frame containing the time to event and status. |
beta_lower |
If dist="gen-gamma", lower limit on possible values for beta. |
beta_upper |
If dist="gen-gamma", upper limit on possible values for beta. |
dist |
String, distribution to fit, selected from among: exp, gamma, gen-gamma log-normal, and weibull. |
eps |
Tolerance for Newton-Raphson iterations. |
init |
List of initial parameters. See individual distributions for the expected parameters. |
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 time for calculating RMSTs. |
time_name |
Name of column containing the time to event. |
An object of class fit
containing the following:
The estimated shape and rate parameters.
The observed information matrix.
The fitted mean, median, and variance.
The estimated RMSTs, if tau was specified.
Between group comparison of survival experience CompParaSurv
Exponential distribution FitExp
Gamma distribution FitGamma
Generalized gamma distribution FitGenGamma
Log-normal distribution FitLogNormal
Weibull distribution FitWeibull
# Generate Gamma data with 20% censoring.
data <- GenData(n = 1e3, dist = "gamma", theta = c(2, 2), p = 0.2)
# Fit gamma distribution.
fit <- FitParaSurv(data, dist = "gamma")
# Generate Weibull data with 10% censoring.
data <- GenData(n = 1e3, dist = "weibull", theta = c(2, 2), p = 0.1)
# Fit weibull distribution, calculate RMST at tau=0.5.
fit <- FitParaSurv(data, dist = "weibull", tau = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.