Description Usage Arguments Value See Also Examples
View source: R/ANOVA_AUC_Group_Specific.R
This function performs a one-way ANOVA to compare the area under the curves of multiple groups marginal dynamics, modeled by group-structured polynomials or B-spline curve in Mixed-Effects model. Before performing the ANOVA, this function can parform a Bartlett's test to evaluate homoscedasticity. In addition to ANOVA, users can decide to evaluate all the 2 by 2 comparisons.
1 2 3 4 5 6 7 8 |
MEM_Pol_group |
A list with similar structure than the output provided by the function MEM_Polynomial_Group_structure. A list containing:
|
Groups |
a vector indicating the names of the groups belonging to the set of groups involved in |
Time_groups |
a list of numerical vectors indicating the time points to consider in AUC calculation for each group (as much elements than the number of groups in |
Nb_id_group |
a numerical vector indicating the number of individuals belonging to each group (as much elements than the number of groups in |
common.interval |
a logical scalar. If TRUE (default) AUCs of all the compared groups are calculated on the same time interval defined as the intersect of all the time interval defined 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 "not-a-knot" spline boundary conditions. |
Averaged |
a logical scalar. If TRUE, AUC are evaluated as normalized AUC (nAUC) where nAUC is computed as the AUC divided by the range of time of calculation. If FALSE (default), the classic AUC is calculated (see Group_specific_AUC_estimation for more details). |
conf_level |
a numerical value (between 0 and 1) indicating the confidence level of the interval. By default, this variable is fixed at 0.95 |
bartlettTest |
a logial scalar indicating whether a bartettTest must be performed before the ANOVA. Default: FALSE |
data |
a dataframe gathering data for the groups involved in the ANOVA that have been fitted by the MEM model summarized in
|
twobytwo.comp |
a logical scalar indicating whether all the 2 by 2 comparisons must be evaluated after the ANOVA. Default: TRUE. |
alternative |
a character scalar specifying the alternative hypothesis for the 2 by 2 comparisons. Options are 'two.sided' (default), 'greater' or 'less'. |
A list of three elements elements:
bartlettTest
: a list of class "htest" corresponding to the Bartlett's test results (see bartlett.test for more details). If the test is not performed, a character 'Not performed' is returned.
ANOVA_F
: a list containing:
Followup
: a vector of two numerical values indicating the time interval when Common.interval
= TRUE. If common.interval
=FALSE, if variable is not included in the list.
Estimated_AUCs
: the vector of AUC estimated for each group involved in the ANOVA.
Estimated_VarAUCs
: the vector of the intra group variance estimated by the MEM (equiv. squared Standard error).
Between
: a vector gathering the between groups sum of squares, degree of freedom and variance with var=SS/df.
Within
: a vector gathering the within groups sum of squares, degree of dreedom and variance with var=SS/df.
ANOVA_F
: the value of the ANOVA statistic F.
Pvalue
: the value of the Pvalue.
Reject_H0
: a boolean indicating whether the null hypothesis (all AUC are equals) is rejected.
TwobyTwo_Comparison
: a list of K sublists where each sublist k gathers results of the kth comparison. If the 2 by 2 comparison is nor performed, a character 'Not performed' is returned.
Groups
: a vector indicating the 2 compared groups.
Estimated.AUC
: a vector of the 2 estimated values of AUC.
Delta_AUC
: the value of the difference of AUC between the 2 compared groups.
Tstat
: the value of the t-statistic.
Pvalue
: the P-value (without any adjustment on multiple tests).
Conf.int
: the confidence interval.
Adjusted.Pvalue
: the P-value adjusted on multiple testing by "bonferroni" method (see p.adjust for more details).
AUC_time_weights_estimation
bartlett.test
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Download of data
data("HIV_Simu_Dataset_Delta01_cens")
data <- HIV_Simu_Dataset_Delta01_cens
colnames(data) <- c("id","time","Group","value","cens")
# Change factors in character vectors
data$id <- as.character(data$id) ; data$Group <- as.character(data$Group)
MEM_estimation <- MEM_Polynomial_Group_structure(y=data$value,x=data$time,Group=data$Group,
Id=data$id,Cens=data$cens)
Groups <- unique(data$Group)
Time_groups <- lapply(seq(1,length(Groups)),function(g)
return(unique(data$time[which(data$Group == Groups[g])])))
Nb_id_group <- sapply(seq(1,length(Groups)),function(g)
return(length(unique(data$id[which(data$Group == Groups[g])]))))
ANOVA_test <- ANOVA_AUC_Group_Specific(MEM_Pol_group=MEM_estimation,Groups=Groups,
Time_groups=Time_groups,Nb_id_group=Nb_id_group,
common.interval=TRUE,method="trapezoid",Averaged=FALSE,
conf_level=0.95,bartlettTest=TRUE,data=data,
twobytwo.comp=TRUE,alternative="two.sided")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.