View source: R/plotfunctions.R

ComparePlot | R Documentation |

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

ComparePlot( eefAnalyticsList, group, Conditional = TRUE, ES_Total = TRUE, modelNames )

`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. |

`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.

Returns a bar plot to compare the different methods. The returned figure can be further modified as any `ggplot`

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) }

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.