Description Usage Arguments Value See Also Examples
View source: R/Group_specific_Var_AUC_estimation.R
This function calculates the variance of the area under the curve of marginal dynamics modeled by group-structured polynomials or B-spline curves in Mixed-Effects models
1 2 3 4 | Group_specific_Var_AUC_estimation(
MEM_Pol_group,time,Groups = NULL,
method = "trapezoid",Averaged = FALSE
)
|
MEM_Pol_group |
A list with similar structure than the output provided by the function MEM_Polynomial_Group_structure. A list containing:
|
time |
a numerical vector of time points (x-axis coordinates) or a list of numerical vectors (with as much elements than the number of groups in |
Groups |
a vector indicating the names of the groups belonging to the set of groups involved in |
method |
a character scalar indicating the interpolation method to use to estimate the AUC. Options are 'trapezoid' (default), 'lagrange' and 'spline'. In this version, the 'spline' interpolation is implemented with the "not-a-knot" spline boundary conditions. |
Averaged |
a logical scalar. If TRUE, the function return the normalized AUC (nAUC) computed as the AUC divided by the range of the time calculation. If FALSE (default), the classic AUC is calculated. (See Group_specific_AUC_estimation for more details about calculation) |
A numerical vector containing the estimation of the variance of the AUC (or nAUC) for each group defined in the Groups
vector.
bs
,
MEM_Polynomial_Group_structure
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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | # Download of data
data("HIV_Simu_Dataset_Delta01_cens")
data <- HIV_Simu_Dataset_Delta01_cens
# Change factors in character vectors
data$id <- as.character(data$id) ; data$Group <- as.character(data$Group)
# Example 1: We consider the variable \code{MEM_Pol_Group} as the output of our function
# \link[AUCcomparison]{MEM_Polynomial_Group_structure}
MEM_estimation <- MEM_Polynomial_Group_structure(y=data$VL,x=data$time,Group=data$Group,
Id=data$id,Cens=data$cens)
time_group1 <- unique(data$time[which(data$Group == "Group1")])
time_group2 <- unique(data$time[which(data$Group == "Group2")])
Var_AUC_estimation <- Group_specific_Var_AUC_estimation(MEM_Pol_group=MEM_estimation,
time=list(time_group1,time_group2))
# Example 2: We consider results of MEM estimation from another source.
# We have to give build the variable 'MEM_Pol_group' with the good structure
# We build the variable 'MEM_Pol_group.1' with the results of MEM estimation obtained for 2 groups
# Generation of random matrix
Covariance_Matrix_1 <- matrix(rnorm(7*7,mean=0,sd=0.01),ncol=7,nrow=7)
# Transform the matrix into symmetric one
Covariance_Matrix_1 <- Covariance_Matrix_1 %*% t(Covariance_Matrix_1)
MEM_Pol_group.1 <- list(Model_estimation=Covariance_Matrix_1,
Model_features=list(Groups=c("Group1","Group2"),
Marginal.dyn.feature=list(dynamic.type="polynomial",
intercept=c(global.intercept=TRUE,
group.intercept1=FALSE,group.intercept2=FALSE),
polynomial.degree=c(3,3))))
Var_AUC_estimation_G1.1 <- Group_specific_Var_AUC_estimation(MEM_Pol_group.1,
time=time_group1,Groups=c("Group1"))
# We build the variable 'MEM_Pol_group.2' with the results of MEM estimation obtained only for the
# group of interest (extraction)
# Generation of random matrix
Covariance_Matrix_2 <- matrix(rnorm(4*4,mean=0,sd=0.01),ncol=4,nrow=4)
# Transform the matrix into a symmetric one
Covariance_Matrix_2 <- Covariance_Matrix_2 %*% t(Covariance_Matrix_2)
MEM_Pol_group.2 <- list(Model_estimation=Covariance_Matrix_2,
Model_features=list(Groups=c("Group1"),
Marginal.dyn.feature=list(dynamic.type="polynomial",
intercept=c(global.intercept=TRUE,
group.intercept1=FALSE),
polynomial.degree=c(3))))
Var_AUC_estimation_G1.2 <- Group_specific_Var_AUC_estimation(MEM_Pol_group=MEM_Pol_group.2,
time=time_group1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.