Type: | Package |
Title: | Analysis of Survival Data under Graphical and Measurement Error Models |
Version: | 0.1.0 |
Description: | The estimation method proposed by Chen and Yi (2021) <doi:10.1111/biom.13331> is extended to the analysis of survival data, accommodating commonly used survival models while accounting for measurement error and network structures among covariates. |
License: | GPL-3 |
Encoding: | UTF-8 |
Imports: | MASS, ncvreg, glmnet, survival, ahaz, GGally, network, sna, scales |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2025-09-09 18:50:00 UTC; Li-Pang Chen |
Author: | Li-Pang Chen [aut, cre], Grace Y. Yi [aut] |
Maintainer: | Li-Pang Chen <lchen723@nccu.edu.tw> |
Repository: | CRAN |
Date/Publication: | 2025-09-14 16:20:14 UTC |
Survival analysis with graphical and measurement error models
Description
This package extends the estimation method of Chen and Yi (2021) <doi:10.1111/biom.13331> to analyze survival data, supporting commonly used survival models while accounting for measurement error and network structures in covariates.
Details
The R package SurvGME (Survival analysis with Graphical and Measurement Error models) provides functions for implementing estimation methods for commonly used survival models that account for network structures and measurement error in covariates. The functions offer multiple options for users, including the specification of measurement error level and hyperparameters for the implementation of the simulation-extrapolation (SIMEX) method. In addition, the package provides estimated variances of the estimators and tools for visualizing the identified network structures in covariates.
Author(s)
Chen, L.-P. and Yi, G. Y.
Maintainer: Li-Pang Chen <lchen723@nccu.edu.tw>
References
Chen, L.-P. and Yi, G. Y. (2021). Analysis of noisy survival data with graphical proportional hazards measurement error models. Biometrics, 77, 956–969.
SIMEX-based variable selection and network identification under AFT models
Description
This function implements the SIMEX method for the penalized likelihood function to correct for measurement error effects, select informative covariates, and identify the network structure of covariates under accelerated failure time (AFT) models.
Usage
SIMEX_AFT(surv, status, X, Sigma_e, Psi, K, dist, shape, scale, order)
Arguments
surv |
An |
status |
An |
X |
An |
Sigma_e |
A |
Psi |
A user-specified sequence for generating synthetic data in the simulation step of the SIMEX method |
K |
A user-specified integer used for simulating data in the simulation step of the SIMEX method |
dist |
A user-specified distribution for the noise term in the AFT model. Options include Weibull distributions ( |
shape |
A user-specified value for the shape parameter in the distribution ( |
scale |
A user-specified value for the scale parameter in the distribution ( |
order |
A positive integer (no smaller than 1) specifying the order of the polynomial functions used in the extrapolation step of the SIMEX method |
Details
This function implements the SIMEX method to correct for measurement error effects and maximizes the penalized likelihood function under AFT models to perform variable selection, network detection, and estimation of the parameters.
Value
est_beta |
A |
est_theta |
A |
Author(s)
Chen, L.-P. and Yi, G. Y.
References
Chen, L.-P. and Yi, G. Y. (2021). Analysis of noisy survival data with graphical proportional hazards measurement error models. Biometrics, 77, 956–969.
Examples
library(MASS)
library(glmnet)
library(survival)
library(ahaz)
n = 200
p = 4
Z = mvrnorm(n,rep(0,p), diag(1,p))
T = exp(Z[,1]+Z[,2]+Z[,3]*Z[,4] + runif(n,0,1))
C = rexp(n,1)
Y = pmin(T,C)
delta = (T<C)*1
SA = diag(c(0,0.6,0,0.6),dim(Z)[2])
X = Z + mvrnorm(n,rep(0,p), SA)
est_AFT = SIMEX_AFT(Y, delta, X, Sigma_e = SA, Psi = seq(0,1,length=5), K=10,
dist="weibull", shape=4, scale=2, order=2)
SIMEX-based variable selection and network identification under additive hazards models
Description
This function implements the SIMEX method for the penalized likelihood function to correct for measurement error effects, select informative covariates, and identify the network structure of covariates under additive hazards (AH) models.
Usage
SIMEX_AH(surv, status, X, Sigma_e, Psi, K, order)
Arguments
surv |
An |
status |
An |
X |
An |
Sigma_e |
A |
Psi |
A user-specified sequence for generating synthetic data in the simulation step of the SIMEX method |
K |
A user-specified integer used for simulating data in the simulation step of the SIMEX method |
order |
A positive integer (no smaller than 1) specifying the order of the polynomial functions used in the extrapolation step of the SIMEX method |
Details
This function implements the SIMEX method to correct for measurement error effects and maximizes the penalized likelihood function under AH models to perform variable selection, network detection, and estimation of the parameters.
Value
est_beta |
A |
est_theta |
A |
Author(s)
Chen, L.-P. and Yi, G. Y.
References
Chen, L.-P. and Yi, G. Y. (2021). Analysis of noisy survival data with graphical proportional hazards measurement error models. Biometrics, 77, 956–969.
Examples
library(MASS)
library(glmnet)
library(survival)
library(ahaz)
n = 200
p = 4
Z = mvrnorm(n,rep(0,p), diag(1,p))
T = exp(Z[,1]+Z[,2]+Z[,3]*Z[,4] + runif(n,0,1))
C = rexp(n,1)
Y = pmin(T,C)
delta = (T<C)*1
SA = diag(c(0,0.6,0,0.6),dim(Z)[2])
X = Z + mvrnorm(n,rep(0,p), SA)
est_AH = SIMEX_AH(Y, delta, X, Sigma_e = SA, Psi = seq(0,1,length=5), K=10, order=2)
SIMEX-based variable selection and network identification under Cox proportional hazards models
Description
This function implements the SIMEX method for the penalized likelihood function to correct for measurement error effects, select informative covariates, and identify the network structure of covariates under Cox proportional hazards (PH) models.
Usage
SIMEX_PH(surv, status, X, Sigma_e, Psi, K, order)
Arguments
surv |
An |
status |
An |
X |
An |
Sigma_e |
A |
Psi |
A user-specified sequence for generating synthetic data in the simulation step of the SIMEX method |
K |
A user-specified integer used for simulating data in the simulation step of the SIMEX method |
order |
A positive integer (no smaller than 1) specifying the order of the polynomial functions used in the extrapolation step of the SIMEX method |
Details
This function implements the SIMEX method to correct for measurement error effects and maximizes the penalized likelihood function under Cox PH models to perform variable selection, network detection, and estimation of the parameters.
Value
est_beta |
A |
est_theta |
A |
Author(s)
Chen, L.-P. and Yi, G. Y.
References
Chen, L.-P. and Yi, G. Y. (2021). Analysis of noisy survival data with graphical proportional hazards measurement error models. Biometrics, 77, 956–969.
Examples
library(MASS)
library(glmnet)
library(survival)
n = 200
p = 4
Z = mvrnorm(n,rep(0,p), diag(1,p))
T = exp(Z[,1]+Z[,2]+Z[,3]*Z[,4] + runif(n,0,1))
C = rexp(n,1)
Y = pmin(T,C)
delta = (T<C)*1
SA = diag(c(0,0.6,0,0.6),dim(Z)[2])
X = Z + mvrnorm(n,rep(0,p), SA)
est_PH = SIMEX_PH(Y, delta, X, Sigma_e = SA, Psi = seq(0,1,length=5), K=10, order=2)
SIMEX-based variable selection and network identification under the transformation models
Description
This function implements the SIMEX method for two estimating equations to correct for measurement error effects, select informative covariates, and identify the network structure of covariates under the transformation models.
Usage
SIMEX_TM(surv, status, X, Sigma_e, Psi, K, r, order)
Arguments
surv |
An |
status |
An |
X |
An |
Sigma_e |
A |
Psi |
A user-specified sequence for generating synthetic data in the simulation step of the SIMEX method |
K |
A user-specified integer used for simulating data in the simulation step of the SIMEX method |
r |
A user-specified constant greater than 0 and smaller than or equal to 1. When |
order |
A positive integer (no smaller than 1) specifying the order of the polynomial functions used in the extrapolation step of the SIMEX method |
Details
This function implements the SIMEX method to correct for measurement error effects and solves two sets of estimating equations under the transformation models to perform variable selection, network detection, and estimation of the parameters.
Value
est_beta |
A |
est_theta |
A |
Author(s)
Chen, L.-P. and Yi, G. Y.
References
Chen, L.-P. and Yi, G. Y. (2021). Analysis of noisy survival data with graphical proportional hazards measurement error models. Biometrics, 77, 956–969.
Examples
library(MASS)
library(glmnet)
library(survival)
library(ahaz)
n = 50
p = 2
Z = mvrnorm(n,rep(0,p), diag(1,p))
T = exp(Z[,1]+Z[,2]+Z[,1]*Z[,2] + runif(n,0,1))
C = rexp(n,1)
Y = pmin(T,C)
delta = (T<C)*1
SA = diag(c(0.6,0.6),dim(Z)[2])
X = Z + mvrnorm(n,rep(0,p), SA)
est_TM = SIMEX_TM(Y, delta, X, Sigma_e = SA, Psi = seq(0,1,length=5), K=10,
r=1, order=2)
Reporting the estimation results and displaying the network structure
Description
This function reports the selected covariates and displays the estimated network structure.
Usage
VS_network(beta,theta,labels,label.sizes,node.size)
Arguments
beta |
An estimate of |
theta |
An estimate of |
labels |
A list of covariates names. By defaults, positive numerical labels are used. |
label.sizes |
A positive integer displaying the size of labels. The default is 6. |
node.size |
A positive integer displaying the size of nodes in the network. The default is 6. |
Details
This function summarizes the selected covariates and displays the estimated network structure for visualization.
Value
selected_variables |
A list of printed names of selected variables |
graph |
An estimated network structure |
Author(s)
Chen, L.-P. and Yi, G. Y.
References
Chen, L.-P. and Yi, G. Y. (2021). Analysis of noisy survival data with graphical proportional hazards measurement error models. Biometrics, 77, 956–969.
Examples
library(MASS)
library(glmnet)
library(survival)
library(ahaz)
library(network)
library(sna)
library(scales)
set.seed(2025)
n = 200
p = 4
Z = mvrnorm(n,rep(0,p), diag(1,p))
T = exp(Z[,1]+Z[,2]+Z[,3]*Z[,4] + runif(n,0,1))
C = rexp(n,1)
Y = pmin(T,C)
delta = (T<C)*1
SA = diag(c(0,0.6,0,0.6),dim(Z)[2])
X = Z + mvrnorm(n,rep(0,p), SA)
est_PH = SIMEX_PH(Y, delta, X, Sigma_e = SA, Psi = seq(0,1,length=5), K=10, order=2)
VS_network(est_PH$est_beta, est_PH$est_theta,
label.sizes=4, node.size=6)
The bootstrapp method for computing the variances of the estimators
Description
This function uses the bootstrap method to compute the variances of the estimators and the associated p-values.
Usage
bootstrap(surv, status, X, Sigma_e, Psi, K, r, dist, shape, scale, order, B, model)
Arguments
surv |
An |
status |
An |
X |
An |
Sigma_e |
A |
Psi |
A user-specified sequence for generating synthetic data in the simulation step of the SIMEX method |
K |
A user-specified integer used for simulating data in the simulation step of the SIMEX method |
r |
A user-specified constant greater than 0 and smaller than or equal to 1. When |
dist |
A user-specified distribution for the noise term in the AFT model. Options include Weibull distributions ( |
shape |
A user-specified value for the shape parameter in the distribution ( |
scale |
A user-specified value for the scale parameter in the distribution ( |
order |
A positive integer (no smaller than 1) specifying the order of the polynomial functions used in the extrapolation step of the SIMEX method |
B |
A user-specified positive integer specifying the number of bootstrap replications |
model |
The specification of the survival model. Options include the Cox proportional hazards model ( |
Details
This function integrates four sub-functions (SIMEX_PH
, SIMEX_AH
, SIMEX_AFT
, and SIMEX_TM
) to compute the variances and p-values of the estimators using the bootstrap method, under the the Cox proportional hazards model, the additive hazards model, the accelerated failure time model, and the transformation model.
Value
est_beta |
A |
est_theta |
A |
var(beta) |
A |
var(theta) |
A |
p-value_beta |
A |
p-value_theta |
A |
Author(s)
Chen, L.-P. and Yi, G. Y.
References
Chen, L.-P. and Yi, G. Y. (2021). Analysis of noisy survival data with graphical proportional hazards measurement error models. Biometrics, 77, 956–969.
Examples
library(MASS)
library(glmnet)
library(survival)
library(ahaz)
n = 200
p = 4
Z = mvrnorm(n,rep(0,p), diag(1,p))
T = exp(Z[,1]+Z[,2]+Z[,3]*Z[,4] + runif(n,0,1))
C = rexp(n,1)
Y = pmin(T,C)
delta = (T<C)*1
SA = diag(c(0,0.6,0,0.6),dim(Z)[2])
X = Z + mvrnorm(n,rep(0,p), SA)
bootstrap(Y, delta, X, Sigma_e = SA, Psi = seq(0,1,length=5), K=10, order=2,B=5, model="PH")