View source: R/parfrailty_methods.R
parfrailty | R Documentation |
parfrailty
fits shared frailty gamma-Weibull models. It is
specifically designed to work with the function standardize_parfrailty
, which
performs regression standardization in shared frailty gamma-Weibull models.
parfrailty(formula, data, clusterid, init)
formula |
an object of class " |
data |
a data frame containing the variables in the model. |
clusterid |
a string containing the name of a cluster identification variable. |
init |
an optional vector of initial values for the model parameters. |
parfrailty
fits the shared frailty gamma-Weibull model
\lambda(t_{ij}|C_{ij})=\lambda(t_{ij};\alpha,\eta)U_i\exp\{h(C_{ij};\beta)\},
where t_{ij}
and C_{ij}
are the survival time and covariate
vector for subject j
in cluster i
, respectively.
\lambda(t;\alpha,\eta)
is the Weibull baseline hazard function
\eta t^{\eta-1}\alpha^{-\eta},
where \eta
is the shape
parameter and \alpha
is the scale parameter. U_i
is the
unobserved frailty term for cluster i
, which is assumed to have a
gamma distribution with scale = 1/shape = \phi
. h(X;\beta)
is
the regression function as specified by the formula
argument,
parameterized by a vector \beta
. The ML estimates
\{\log(\hat{\alpha}),\log(\hat{\eta}),\log(\hat{\phi}),\hat{\beta}\}
are
obtained by maximizing the marginal (over U
) likelihood.
An object of class "parfrailty"
which is a list containing:
est |
the Maximum Likelihood (ML) estimates |
vcov |
the variance-covariance vector of the ML estimates. |
score |
a matrix containing the cluster-specific contributions to the ML score equations. |
If left truncation is present, it is assumed that it is strong left truncation. This means that even if the truncation time may be subject-specific, the whole cluster is unobserved if at least one subject in the cluster dies before his/her truncation time. If all subjects in the cluster survive beyond their subject-specific truncation times, then the whole cluster is observed (Van den Berg and Drepper, 2016).
Arvid Sjölander and Elisabeth Dahlqwist.
Dahlqwist E., Pawitan Y., Sjölander A. (2019). Regression standardization and attributable fraction estimation with between-within frailty models for clustered survival data. Statistical Methods in Medical Research 28(2), 462-485.
Van den Berg G.J., Drepper B. (2016). Inference for shared frailty survival models with left-truncated data. Econometric Reviews, 35(6), 1075-1098.
require(survival)
# simulate data
set.seed(5)
n <- 200
m <- 3
alpha <- 1.5
eta <- 1
phi <- 0.5
beta <- 1
id <- rep(1:n, each = m)
U <- rep(rgamma(n, shape = 1 / phi, scale = phi), each = m)
X <- rnorm(n * m)
# reparameterize scale as in rweibull function
weibull.scale <- alpha / (U * exp(beta * X))^(1 / eta)
T <- rweibull(n * m, shape = eta, scale = weibull.scale)
# right censoring
C <- runif(n * m, 0, 10)
D <- as.numeric(T < C)
T <- pmin(T, C)
# strong left-truncation
L <- runif(n * m, 0, 2)
incl <- T > L
incl <- ave(x = incl, id, FUN = sum) == m
dd <- data.frame(L, T, D, X, id)
dd <- dd[incl, ]
fit <- parfrailty(formula = Surv(L, T, D) ~ X, data = dd, clusterid = "id")
print(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.