ComparePlot: A plot function to compare different eefAnalytics S3 objects...

Description Usage Arguments Details Value Examples

View source: R/plotfunctions.R

Description

It generates bar plot that compares the effect size from eefAnalytics' methods.

Usage

1
2
3
4
5
6
7
ComparePlot(
  eefAnalyticsList,
  group,
  Conditional = TRUE,
  ES_Total = TRUE,
  modelNames
)

Arguments

eefAnalyticsList

A list of eefAnalytics S3 objects from eefAnalytics package.

group

a string/scalar value indicating which intervention to plot. This must be one of the values of intervention variable excluding the control group. For a two arm trial, the maximum number of values to consider is 1 and 2 for three arm trial.

Conditional

a logical value to indicate whether to plot conditional effect size. The default is Conditional=TRUE, otherwise Conditional=FALSE should be specified for plot based on unconditional effect size. Conditional variance is total or residual variance a multilevel model with fixed effects, whilst unconditional variance is total variance or residual variance from a multilevel model with only intercept as fixed effect.

ES_Total

A logical value indicating whether to plot the effect size based on total variance or within school variance. The default is ES_Total=TRUE, to plot effect size using total variance. ES_Total=FALSE should be specified for effect size based on within school or residuals variance.

modelNames

a string factor containing the names of model to compare. See examples below.

Details

ComparePlot produces a bar plot which compares the effect sizes and the associated confidence intervals from the different models. For a multilevel model, it shows the effect size based on residual variance and total variance.

Value

Returns a bar plot to compare the different methods.

Examples

 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
if(interactive()){

data(mstData)
###############
##### SRT #####
###############

outputSRT <- srtFREQ(Posttest~ Intervention + Prettest,
                     intervention = "Intervention", data = mstData)

outputSRTBoot <- srtFREQ(Posttest~ Intervention + Prettest,
                         intervention = "Intervention",nBoot=1000, data = mstData)

###############
##### MST #####
###############

outputMST <- mstFREQ(Posttest~ Intervention + Prettest,
                     random = "School", intervention = "Intervention", data = mstData)

outputMSTBoot <- mstFREQ(Posttest~ Intervention + Prettest,
                         random = "School", intervention = "Intervention",
                         nBoot = 1000, data = mstData)

##################
##### Bayesian #####
##################

outputSRTbayes <- srtBayes(Posttest~ Intervention + Prettest,
                           intervention = "Intervention",
                           nSim = 2000, data = mstData)

## comparing different results

ComparePlot(list(outputSRT,outputSRTBoot,outputMST,outputMSTBoot,outputSRTbayes),
            modelNames =c("ols", "olsBoot","MLM","MLMBoot","OLSBayes"),group=1)


}

germaine86/eefAnalytics_v10 documentation built on Feb. 20, 2021, 12:13 a.m.