Description Usage Arguments Value See Also Examples
View source: R/Group_specific_Delta_AUC_estimation.R
This function estimates the difference of area under the curve of marginal dynamics from two groups when marginal dynamics are modeled by group-structured polynomials or B-spline curves.
1 2 3 4 5 6 7 8 9 | Group_specific_Delta_AUC_estimation(
MEM_Pol_group,
Group1,
Group2,
time.G1,
time.G2,
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:
| |||||||||||
Group1 |
a character scalar indicating the name of the first group whose marginal dynamics must be considered. This group name must belong to the set of groups involved in the MEM (see | |||||||||||
Group2 |
a character scalar indicating the name of the second group whose marginal dynamics must be considered. This group name must belong to the set of groups involved in the MEM (see | |||||||||||
time.G1 |
a numerical vector of time points (x-axis coordinates) to use for the Group1 AUC calculation. | |||||||||||
time.G2 |
a numerical vector of time points (x-axis coordinates) to use for the Group2 AUC calculation. | |||||||||||
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 "not-a-knot" spline boundary conditions. | |||||||||||
Averaged |
a logical scalar. If TRUE, the function return the difference of normalized AUC (nAUC) where nAUC is computated as the AUC divided by the range of time of calculation. If FALSE (default), the classic AUC is calculated. |
A numerical scalar defined as \mjseqn\Delta \textAUC = \textAUC_2 - \textAUC_1 (or \mjseqn\Delta\textnAUC = \textnAUC_2 - \textnAUC_1) with \mjseqn\textAUC_1 (or \mjseqn\textnAUC_1) and \mjseqn\textAUC_2 (or \mjseqn\textnAUC_2) being respectively estimated as the AUC (or nAUC) for the Group1 and for the Group2.
MEM_Polynomial_Group_structure
,
Group_specific_AUC_estimation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 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[AUCtest]{MEM_Polynomial_Group_structure}
MEM_estimation_1 <- MEM_Polynomial_Group_structure(y=data$VL,x=data$time,Group=data$Group,Id=data$id,Cens=data$cens)
Delta_AUC_1 <- Group_specific_Delta_AUC_estimation(MEM_Pol_group=MEM_estimation_1,Group1="Group1",Group2="Group2",
time.G1=unique(data$time[which(data$Group=="Group1")]),
time.G2=unique(data$time[which(data$Group=="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_estimation_2' with the results of MEM estimation obtained for two groups
MEM_estimation_2 <- list(Model_estimation=c(1.077,0.858,-0.061,0.0013,0.887,-0.066,0.0014), # c(global.intercept,beta1.G1,beta2.G1,beta2.G1,beta1.G2,beta2.G2,beta3.G2)
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))))
Delta_AUC_2 <- Group_specific_Delta_AUC_estimation(MEM_Pol_group=MEM_estimation_2,Group1="Group1",Group2="Group2",
time.G1=unique(data$time[which(data$Group=="Group1")]),
time.G2=unique(data$time[which(data$Group=="Group2")]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.