Description Usage Arguments Details Value Note Author(s) References Examples
parfrailty
fits shared frailty gamma-Weibull models. It is specifically
designed to work with the function stdParfrailty
, which performs regression
standardization in shared frailty gamma-Weibull models.
1 | parfrailty(formula, data, clusterid, init)
|
formula |
an object of class " |
data |
a data frame containing the variables in the model. |
clusterid |
an 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
λ(t_{ij}|C_{ij})=λ(t_{ij};α,η)U_iexp\{h(C_{ij};β)\},
where t_{ij} and C_{ij} are the survival time and covariate vector for subject j in cluster i, respectively. λ(t;α,η) is the Weibull baseline hazard function
η t^{η-1}α^{-η},
where η is the shape parameter and α 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 = φ. h(X;β)
is the regression function as specified by the formula
argument,
parametrized by a vector β. The ML estimates
\{log(\hat{α}),log(\hat{η}),log(\hat{φ}),\hat{β}\}
are obtained by maximizing the marginal (over U) likelihood.
An object of class "parfrailty"
is a list containing:
est |
the ML estimates \{log(\hat{α}),log(\hat{η}), log(\hat{φ}),\hat{β}\}. |
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 Sjolander and Elisabeth Dahlqwist.
Dahlqwist E., Pawitan Y., Sjolander 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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ## Not run:
require(survival)
#simulate data
n <- 1000
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)
#reparametrize 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(summary(fit))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.