Description Usage Arguments Details 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 | Group_specific_Delta_AUC_estimation(
MEM_Pol_group,Group1,Group2,
time.G1,time.G2,common.interval = TRUE,
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. |
common.interval |
a logical scalar. If FALSE, the difference of AUC is calculated as the difference of AUCs where the AUC of each group is calculated on its specific interval of time. If TRUE (default), the difference of AUC is estimated on a common interval of time defined as the intersect of the two group-specific interval (see @details for more details). |
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. |
The difference of area under the curve between the two groups of interest is calculated as an approximation of the difference of the integrals of the expected value of the estimated outcome Y specific to the two groups g1 and g2.
Assuming a time interval \mjteqn[0,T_g1][0,T_g1][0,T_g1] for the group 1 and \mjteqn[0,T_g2][0,T_g2][0,T_g2] for the group 2, the difference of AUC is then calculated as
\mjtdeqn\Delta AUC = \int_0^T_g_2 E(\hatY_g_2)(t) dt - \int_0^T_g_1 E(\hatY_g_1)(t) dt\Delta AUC = \int_0^T_g_2 E(\hatY_g_2)(t) dt - \int_0^T_g_1 E(\hatY_g_1)(t) dt\Delta AUC = \int_0^T_g_2 E(\hatY_g_2)(t) dt - \int_0^T_g_1 E(\hatY_g_1)(t) dt
Similarly, the difference of the normalized AUC (\mjteqn\Delta nAUC\Delta nAUC\Delta nAUC) for these two same groups is then defined as
\mjtdeqn\Delta nAUC = \frac1T_g_2\int_0^T_g_2 E(\hatY_g_2)(t) dt - \frac1T_g_1\int_0^T_g_1 E(\hatY_g_1)(t) dt\Delta nAUC = \frac1T_g_2\int_0^T_g_2 E(\hatY_g_2)(t) dt - \frac1T_g_1\int_0^T_g_1 E(\hatY_g_1)(t) dt\Delta nAUC = \frac1T_g_2\int_0^T_g_2 E(\hatY_g_2)(t) dt - \frac1T_g_1\int_0^T_g_1 E(\hatY_g_1)(t) dt
When we want to estimate the difference of AUC (or nAUC) on the same time interval for the two groups (common.interval
= TRUE), we define \mjteqnT = \min(T_g_1,T_g_2))T = \min(T_g_1,T_g_2))T = \min(T_g_1,T_g_2)) and we calculate the difference of AUC as
\mjtdeqn\Delta AUC = \int_0^T E(\hatY_g_2)(t) dt - \int_0^T E(\hatY_g_1)(t) dt\Delta AUC = \int_0^T E(\hatY_g_2)(t) dt - \int_0^T E(\hatY_g_1)(t) dt\Delta AUC = \int_0^T E(\hatY_g_2)(t) dt - \int_0^T E(\hatY_g_1)(t) dt
\mjtdeqn\Delta nAUC = \frac1T\int_0^T E(\hatY_g_2)(t) dt - \frac1T\int_0^T E(\hatY_g_1)(t) dt\Delta nAUC = \frac1T\int_0^T E(\hatY_g_2)(t) dt - \frac1T\int_0^T E(\hatY_g_1)(t) dt\Delta nAUC = \frac1T\int_0^T E(\hatY_g_2)(t) dt - \frac1T\int_0^T E(\hatY_g_1)(t) dt
A numerical scalar defined as \mjteqn\Delta AUC = AUC_2 - AUC_1\Delta AUC = AUC_2 - AUC_1\Delta AUC = AUC_2 - AUC_1 (or \mjteqn\Delta nAUC = nAUC_2 - nAUC_1\Delta nAUC = nAUC_2 - nAUC_1\Delta nAUC = nAUC_2 - nAUC_1) with \mjteqnAUC_1AUC_1AUC_1 (or \mjteqnnAUC_1nAUC_1nAUC_1) and \mjteqnAUC_2AUC_2AUC_2 (or \mjteqnnAUC_2nAUC_2nAUC_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 22 23 24 25 26 27 28 29 30 31 | # 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_1 <- 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")])
Delta_AUC_1 <- Group_specific_Delta_AUC_estimation(MEM_Pol_group=MEM_estimation_1,
Group1="Group1",Group2="Group2",
time.G1=time_group1,time.G2=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_estimation_2' with the results of MEM estimation obtained for 2 groups
MEM_estimation_2 <- list(Model_estimation=c(1.077,0.858,-0.061,0.0013,0.887,-0.066,0.0014),
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=time_group1,time.G2=time_group2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.