An overview on pakcage aides

CRAN Lifecycle: stable Licence


1 Brief overview

Package aides is planned to support users to do additional analysis or graphics. Users can use functions in aides by calling the library with following syntax:

library(aides)


2 Features

Briefly, aides currently consists of three tasks as follows:


3 Functions and examples

Users can import their data and do relevant tests or graphics using functions in package aides. The present package consists of four functions listed as follows:

Disparity:

PlotDistrSS() Lifecycle: stable, TestDisparity() Lifecycle: stable, and PlotDisparity() Lifecycle: stable.


Discordance:

TestDiscordance() Lifecycle: experimental.


Sequential analysis:

DoSA() Lifecycle: stable, DoOSA() Lifecycle: stable, and PlotOSA() Lifecycle: stable.


3.1 Examples of functions:

3.1.1 Disparity:

The following steps and syntax demonstrate how user can carry out disparity test. Figure 3.2 visualizes the test based on the excessive cases of oulier(s).

Step 1. Import data (Olkin 1995)

library(meta)
data("Olkin1995")
dataOlkin1995 <- Olkin1995


Step 2. Process data

dataOlkin1995$n <- dataOlkin1995$n.exp + dataOlkin1995$n.cont


Step 3. Check distribution of study sizes. Using function shapiro.test() is a simple way to test whether sample sizes distribute normally, and further visualization with statistics can be carried out by function PlotDistrSS().

shapiro.test(dataOlkin1995$n)
PlotDistrSS(dataOlkin1995$n)

#> 
#>  Shapiro-Wilk normality test
#> 
#> data:  dataOlkin1995$n
#> W = 0.2596, p-value < 2.2e-16
An example for visualization of distribution of study sizes

Figure 3.1: An example for visualization of distribution of study sizes


Step 4. Test assumption of disparity in study size

TestDisparity(n = n, 
              data = dataOlkin1995, 
              study = author, 
              time = year)
#> Summary of disparities in sample size test:
#> Number of outliers = 13 (Excessive cases = 36509; P-value < 0.001)
#> Variability = 3.658 (P-value < 0.001)
#> 
#> Outlier detection method: MAD
#> Variability detection method: CV


Step 5. Illustrate disparity plot

TestDisparity(n = n,
              data = dataOlkin1995, 
              study = author, 
              time = year, 
              plot = TRUE)
An example for disparity-outlier plot

Figure 3.2: An example for disparity-outlier plot


Due to non-normal distribution among the study sizes as shown in Step 3 (Figure 3.1 and also see the result of shapiro test), robust method is recommended for testing variability, which can be carried out by the following syntax:

rsltDisparity <- TestDisparity(n = n, 
                               data = dataOlkin1995, 
                               study = author, 
                               time = year,
                               vrblty = "MAD")
#> Summary of disparities in sample size test:
#> Number of outliers = 13 (Excessive cases = 36509; P-value < 0.001)
#> Variability = 0.951 (P-value < 0.001)
#> 
#> Outlier detection method: MAD
#> Variability detection method: MAD


The following syntax instead of step 5 aforementioned is recommended for illustrating disparity plot of variability based on robust coefficient of variation:

PlotDisparity(rsltDisparity, 
              which = "CV", 
              szFntAxsX = 1)
An example for disparity-variability (robust) plot

Figure 3.3: An example for disparity-variability (robust) plot


3.1.2 Discordance:

The following steps and syntax demonstrate how user can carry out discordance test. Figure 3.4 visualizes the test.

Step 1. Import data (example of the study by Fleiss 1993)

library(meta)
data("Fleiss1993bin")
dataFleiss1993bin <- Fleiss1993bin


Step 2. Process data

dataFleiss1993bin$n  <- dataFleiss1993bin$n.asp + dataFleiss1993bin$n.plac
dataFleiss1993bin$se <- sqrt((1 / dataFleiss1993bin$d.asp) - (1 / dataFleiss1993bin$n.asp) + (1 / dataFleiss1993bin$d.plac) - (1 / dataFleiss1993bin$n.plac))


Step 3. Test assumption of discordance in study size

TestDiscordance(n = n, 
                se = se, 
                study = study,
                data = dataFleiss1993bin)
#> Summary of discordance in ranks test:
#>  Statistics (Bernoulli exact): 2
#>  P-value: 0.423
#>  Note: No significant finding in the test of discordance in study size ranks.


Step 4. Illustrate discordance plot

TestDiscordance(n = n, 
                se = se, 
                study = study, 
                data = dataFleiss1993bin, 
                plot = TRUE)
An example for discordance plot

Figure 3.4: An example for discordance plot


3.1.3 Sequential analysis:

The following steps and syntax demonstrate how user can carry out sequential analysis. Figure 3.5 sequential analysis plot.

Step 1. Import data (example of the study by Fleiss 1993)

library(meta)
data("Fleiss1993cont")
dataFleiss1993cont <- Fleiss1993cont


Step 2. Do sequential analysis

DoSA(Fleiss1993cont, 
     source = study, 
     time = year,
     m1 = mean.psyc, 
     sd1 = sd.psyc, 
     n1 = n.psyc,
     m2 = mean.cont, 
     sd2 = sd.cont, 
     n2 = n.cont,
     measure = "SMD", 
     PES = 0.2,
     group = c("Psychotherapy", "Control"), 
     plot = FALSE)
#> Summary of sequential analysis (main information)
#>  Acquired sample size: 232
#>  Required sample size (without adjusted): 3260
#>  Cumulative z score: -2.556
#>  Alpha-spending boundary: 7.347 and -7.347
#>  Adjusted confidence interval is suggested to be performed.
#> 
#> Adjusted confidence interval based on type I error < 0.000001: 
#> -1.072 to 0.386
#> 
#> Summary of sequential analysis (additional information)
#>  1. Assumed information
#>  1.1. Defined type I error: 0.05
#>  1.2. Defined type II error: 0.2
#>  1.3. Defined power: 0.8
#>  1.4. Presumed effect: 0.2
#>  1.5. Presumed variance: 4.153
#> 
#>  2. Meta-analysis
#>  2.1. Setting of the meta-analysis
#>  Data were pooled using inverse variance in random-effects model with DL method.
#>  2.2. Result of the meta-analysis 
#>  SMD: -0.343 (95% CI: -0.607 to -0.08)
#>  
#>  3. Adjustment factor 
#>  The required information size is calculated without adjustment factor. Relevant parameters are listed as follows.
#>  3.1. Heterogeneity (I-squared): 0%
#>  3.2. Diversity (D-squared): 0%
#>  3.3. Adjustement factor: Undefined


Step 3. Visualize sequential analysis

DoSA(Fleiss1993cont, 
     source = study, 
     time = year,
     m1 = mean.psyc, 
     sd1 = sd.psyc, 
     n1 = n.psyc,
     m2 = mean.cont, 
     sd2 = sd.cont, 
     n2 = n.cont,
     measure = "SMD", 
     PES = 0.2,
     group = c("Psychotherapy", "Control"))
An example for sequential analysis

Figure 3.5: An example for sequential analysis


Observed sequential analysis is recommended for those pooled analysis without pre-specified parameters for sequential analysis. In this situation, thus, Step 2 should use following syntax:

DoOSA(Fleiss1993cont, 
     source = study, 
     time = year,
     m1 = mean.psyc, 
     sd1 = sd.psyc, 
     n1 = n.psyc,
     m2 = mean.cont, 
     sd2 = sd.cont, 
     n2 = n.cont,
     measure = "SMD", 
     group = c("Psychotherapy", "Control"))
#> Summary of observed sequential analysis (main information)
#>  Acquired sample size: 232
#>  Optimal sample size (without adjusted): 1106
#>  Cumulative z score: -2.556
#>  Alpha-spending boundary: 4.278 and -4.278
#>  Adjusted confidence interval is suggested to be performed.
#> 
#> Adjusted confidence interval based on type I error 9.42059679664986e-06: 
#> -0.939 to 0.252
#> 
#> Summary of observed sequential analysis (additional information)
#>  1. Observed information
#>  1.1. Defined type I error: 0.05
#>  1.2. Defined type II error: 0.2
#>  1.3. Defined power: 0.8
#>  1.4. Observed effect size -0.343
#>  1.5. Observed variance: 4.153
#> 
#>  2. Meta-analysis
#>  2.1. Setting of the meta-analysis
#>  Data were pooled using inverse variance in random-effects model with DL method.
#>  2.2. Result of the meta-analysis 
#>  SMD: -0.343 (95% CI: -0.607 to -0.08)
#>  
#>  3. Adjustment factor 
#>  The optimal information size is calculated without adjustment factor. Relevant parameters are listed as follows.
#>  3.1. Heterogeneity (I-squared): 0%
#>  3.2. Diversity (D-squared): 0%
#>  3.3. Adjustement factor: Undefined


Plot for observed sequential analysis can be simply illustrated using is the following syntax instead of step 3 abovementioned:

DoOSA(Fleiss1993cont, 
     source = study, 
     time = year,
     m1 = mean.psyc, 
     sd1 = sd.psyc, 
     n1 = n.psyc,
     m2 = mean.cont, 
     sd2 = sd.cont, 
     n2 = n.cont,
     measure = "SMD", 
     group = c("Psychotherapy", "Control"),
     plot = TRUE)
An example for observed sequential analysis plot

Figure 3.6: An example for observed sequential analysis plot