sm4: 4-State Semi-Markov Model

Description Usage Arguments Details Value Author(s) References Examples

View source: R/sm4.R

Description

The 4-state SM model includes an initial state (X=1), a transient state (X=2) and two absorbing states (X=3 and X=4). Usually, X=1 corresponds to disease-free or remission and X=4 to death. The possible transitions are: 1->2, 1->3, 1->4, 2->3 and 2->4.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sm4(t1, t2, sequence, weights=NULL, dist, 
cuts.12=NULL, cuts.13=NULL, cuts.14=NULL, cuts.23=NULL, cuts.24=NULL,
ini.base.12=NULL, ini.base.13=NULL, ini.base.14=NULL,
ini.base.23=NULL, ini.base.24=NULL,
cov.12=NULL, init.cov.12=NULL, names.12=NULL,
cov.13=NULL, init.cov.13=NULL, names.13=NULL,
cov.14=NULL, init.cov.14=NULL, names.14=NULL, 
cov.23=NULL, init.cov.23=NULL, names.23=NULL,
cov.24=NULL, init.cov.24=NULL, names.24=NULL,
conf.int=TRUE, silent=TRUE, precision=10^(-6))

Arguments

t1

A numeric vector with the observed times in days from baseline to the first transition (X=2, X=3 or X=4) or to the right-censoring (in X=1 at the last follow-up).

t2

A numeric vector with the observed times in days from baseline to the second transition or to the right censoring (in X=2 at the last follow-up). NA for individuals right-censored in X=1 or individuals who directly transited from X=1 to X=3 or X=4.

sequence

a numeric vector with the sequence of observed states. Six possible values are allowed: 1 (individual right-censored in X=1), 12 (individual right-censored in X=2), 13 (individual who directly transited from X=1 to X=3), 14 (individual who directly transited from X=1 to X=4), 123 (individual who transited from X=1 to X=3 through X=2), 124 (individual who transited from X=1 to X=4 through X=2).

weights

A numeric vector with the weights for correcting the contribution of each individual. When the vector is completed, the IPW estimator is implemented. Default is NULL which means that no weighting is applied.

dist

A character vector with three arguments describing respectively the distributions of duration time for transitions 1->2, 1->3 and 2->3. Arguments allowed are "E" for Exponential distribution, "PE" for the piecewise exponential distribution, "W" for Weibull distribution or "WG" for Generalized Weibull distribution. When the user choose "PE", the arguments "cut.XX" have also to be defined.

cuts.12

A numeric vector indicating the timepoints in days for the piecewise exponential distribution related to the time from X=1 to X=2. Only internal timepoints are allowed: timepoints cannot be 0 or Inf. Default is NULL which means that the distribution is not piecewise. Piecewise model is only allowed for exponential distribution.

cuts.13

A numeric vector indicating the timepoints in days for the piecewise exponential distribution related to the time from X=1 to X=3. Only internal timepoints are allowed: timepoints cannot be 0 or Inf. Default is NULL which means that the distribution is not piecewise. Piecewise model is only allowed for exponential distribution.

cuts.14

A numeric vector indicating the timepoints in days for the piecewise exponential distribution related to the time from X=1 to X=4. Only internal timepoints are allowed: timepoints cannot be 0 or Inf. Default is NULL which means that the distribution is not piecewise. Piecewise model is only allowed for exponential distribution.

cuts.23

A numeric vector indicating the timepoints in days for the piecewise exponential distribution related to the time from X=2 to X=3. Only internal timepoints are allowed: timepoints cannot be 0 or Inf. Default is NULL which means that the distribution is not piecewise. Piecewise model is only allowed for exponential distribution.

cuts.24

A numeric vector indicating the timepoints in days for the piecewise exponential distribution related to the time from X=2 to X=4. Only internal timepoints are allowed: timepoints cannot be 0 or Inf. Default is NULL which means that the distribution is not piecewise. Piecewise model is only allowed for exponential distribution.

ini.base.12

A numeric vector of initial values for the distribution from X=1 to X=2. The logarithm of the parameters have to be declared. Default value is 1.

ini.base.13

A numeric vector of initial values for the distribution from X=1 to X=3. The logarithm of the parameters have to be declared. Default value is 1.

ini.base.14

A numeric vector of initial values for the distribution from X=1 to X=4. The logarithm of the parameters have to be declared. Default value is 1.

ini.base.23

A numeric vector of initial values for the distribution from X=2 to X=3. The logarithm of the parameters have to be declared. Default value is 1.

ini.base.24

A numeric vector of initial values for the distribution from X=2 to X=4. The logarithm of the parameters have to be declared. Default value is 1.

cov.12

A matrix (or data frame) with the explicative time-fixed variable(s) related to the time from X=1 to X=2.

init.cov.12

A numeric vector of initial values for regression coefficients (logarithm of the cause-specific hazards ratios) associated to cov.12. Default initial value is 0.

names.12

An optional character vector with name of explicative variables associated to cov.12.

cov.13

A numeric matrix (or data frame) with the explicative time-fixed variable(s) related to the time from X=1 to X=3.

init.cov.13

A numeric vector of initial values for regression coefficients (logarithm of the cause-specific hazards ratios) associated to cov.13. Default initial value is 0.

names.13

An optional character vector with name of explicative variables associated to cov.13.

cov.14

A numeric matrix (or data frame) with the explicative time-fixed variable(s) related to the time from X=1 to X=4.

init.cov.14

A numeric vector of initial values for regression coefficients (logarithm of the cause-specific hazards ratios) associated to cov.14. Default initial value is 0.

names.14

An optional character vector with name of explicative variables associated to cov.14.

cov.23

A numeric matrix (or data frame) with the explicative time-fixed variable(s) related to the time from X=2 to X=3.

init.cov.23

A numeric vector of initial values for regression coefficients (logarithm of the cause-specific hazards ratios) associated to cov.23. Default initial value is 0.

names.23

An optional character vector with name of explicative variables associated to cov.23.

cov.24

A numeric matrix (or data frame) with the explicative time-fixed variable(s) related to the time from X=2 to X=4.

init.cov.24

A numeric vector of initial values for regression coefficients (logarithm of the cause-specific hazards ratios) associated to cov.24. Default initial value is 0.

names.24

An optional character vector with name of explicative variables associated to cov.24.

conf.int

A logical value specifying if the pointwise confidence intervals for parameters and the variance-covariance matrix should be returned. Default is TRUE.

silent

A logical value specifying if the log-likelihood value should be returned at each iteration. Default is TRUE, which corresponds to silent mode (no display).

precision

A numeric positive value indicating the required precision for the log-likelihood maximization between each iteration. Default is 10^{-6}.

Details

Hazard functions available are:

Exponential distribution λ(t)=1/σ
Weibull distribution λ(t)=ν(\frac{1}{σ})^{ν}t^{ν-1}
Generalized Weibull distribution λ(t)=\frac{1}{θ}≤ft(1+≤ft(\frac{t}{σ}\right)^{ν}\right)^{\frac{1}{θ}-1} ν≤ft(\frac{1}{σ}\right)^{ν} t^{ν-1}

with σ, ν,and θ>0. The parameter σ varies for each interval when the distribution is piecewise Exponential. We advise to initialize the logarithm of these parameters in ini.base.12, ini.base.13 and ini.base.23.

To estimate the marginal effect of a binary exposure, the weights may be equal to 1/p, where p is the estimated probability that the individual belongs to his or her own observed group of exposure. The probabilities p are often estimated by a logistic regression in which the dependent binary variable is the exposure. The possible confounding factors are the explanatory variables of this logistic model.

Value

object

A character string indicating the estimated model: "sm4 (4-state semi-Markov model)".

dist

A character vector with two arguments describing respectively the distributions of duration time for transitions 1->2, 1->3, 1->4, 2->3, and 2->4.

cuts.12

A numeric vector indicating the timepoints in days for the piecewise exponential distribution related to the time from X=1 to X=2.

cuts.13

A numeric vector indicating the timepoints in days for the piecewise exponential distribution related to the time from X=1 to X=3.

cuts.14

A numeric vector indicating the timepoints in days for the piecewise exponential distribution related to the time from X=1 to X=4.

cuts.23

A numeric vector indicating the timepoints in days for the piecewise exponential distribution related to the time from X=2 to X=3.

cuts.24

A numeric vector indicating the timepoints in days for the piecewise exponential distribution related to the time from X=2 to X=4.

covariates

A numeric vector indicating the numbers of covariates respectively related to the transition 1->2, 1->3, 1->4, 2->3, and 2->4.

table

A data frame containing the estimated parameters of the model (Estimate). When the option conf.int=TRUE is specified, this data frame includes three additional columns: the Standard Errors of parameters (Std.Error), the value of the Wald statistic (t.value), and the related p-value for the Wald test (Pr(>|t|)).

cov.matrix

A data frame corresponding to variance-covariance matrix of the parameters.

LogLik

A numeric value corresponding to the (weighted) log-likelihood of the model.

AIC

A numeric value corresponding to the Akaike Information Criterion of the model.

Author(s)

Yohann Foucher <Yohann.Foucher@univ-nantes.fr> and

Florence Gillaizeau <Florence.Gillaizeau@univ-nantes.fr>

References

Gillaizeau F, Dantan E, Giral M, Foucher Y. A multistate additive relative survival semi-Markov model. Statistical methods in medical research Jun 2015. <DOI: 10.1177/ 0962280215586456>

Gillaizeau F, Senage T, Le Borgne F, Le Tourneau T, Roussel JC, Leffondre K, Porcher R, Giraudeau B, Dantan E, Foucher Y. Inverse Probability Weighting to control confounding in an illness-death model for interval-censored data. Manuscript submitted. 2016.

Austin PC. An Introduction to Propensity Score Methods for Reducing the Effects of Confounding in Observational Studies. Multivariate Behav Res May 2011; 46(3): 399-424. <DOI: 10.1080/ 00273171.2011.568786>

Examples

 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
# import the observed data
# (X=1 corresponds to initial state with a functioning graft, X=2 to acute rejection episode, 
# X=3 to return to dialysis, X=4 to death with a functioning graft)

data(dataDIVAT)

# A subgroup analysis to reduce the time needed for this example

dataDIVAT$id<-c(1:nrow(dataDIVAT))
set.seed(2)
d4<-dataDIVAT[dataDIVAT$id %in% sample(dataDIVAT$id, 200, replace = FALSE),]

# 4-state parametric semi-Markov model including one explicative variable  
# (z is the delayed graft function) on the transition from X=1 to X=2

# Note: a semi-Markovian process with sojourn times exponentially distributed
# is a time-homogeneous Markov process

# We only reduced the precision and the number of iteration to save time in this example,
# prefer the default values.

sm4(t1=d4$time1, t2=d4$time2, sequence=d4$trajectory, dist=c("E","E","E","E","E"),
  ini.base.12=c(8.31), ini.base.13=c(10.46), ini.base.14=c(10.83),
  ini.base.23=c(9.01), ini.base.24=c(10.81),
  cov.12=d4$z, init.cov.12=c(-0.02), names.12=c("beta12_z"),
  conf.int=TRUE,  silent=FALSE,  precision=0.001)$table

multistate documentation built on May 2, 2019, 5:16 a.m.