Description Usage Arguments Details Value Examples
View source: R/plotfunctions.R
Plots different figures based on output from eefAnalytics package.
| 1 2 | 
| x | an output object from the 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 the conditional effect size. The default is Conditional=TRUE, otherwise Conditional=FALSE should be specified for plot based on the unconditional effect size. Conditional variance is total or residual variance from 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 the effect size using total variance. ES_Total=FALSE should be specified for the effect size based on within school or residuals variance. | 
| slope | A logical value indicating whether to return the plot of random intercept (default is slope=FALSE). return other school-by-intervention interaction random slope (s) is slope=TRUE. This argument is suitable only for mstBayes and mstFREQ functions. | 
| ... | arguments passed to  | 
Plot produces a graphical visualisation depending on which model is fitted:
 For srtFREQ(), plot can only be used when nBoot or nPerm is specified to visualise the distribution of bootstrapped or permutated values.
 For crtFREQ() or mstFREQ(), plot shows the distribution of random intercepts when group=NULL.
It produces histogram of permutated or bootstrapped values when group is specified and either nBoot or nPerm is also specified.
Returns relevant plots for each model.
| 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | if(interactive()){
#### read data
data(mstData)
data(crtData)
###############
##### SRT #####
###############
##### Bootstrapped
outputSRTBoot <- srtFREQ(Posttest~ Intervention + Prettest,
                         intervention = "Intervention",nBoot=1000, data = mstData)
plot(outputSRTBoot,group=1)
##### Permutation
outputSRTPerm <- srtFREQ(Posttest~ Intervention + Prettest,
                         intervention = "Intervention",nPerm=1000, data = mstData)
plot(outputSRTPerm,group=1)
###############
##### MST #####
###############
#### Random intercepts
outputMST <- mstFREQ(Posttest~ Intervention + Prettest,
                     random = "School", intervention = "Intervention", data = mstData)
plot(outputMST)
#### Bootstrapped
outputMSTBoot <- mstFREQ(Posttest~ Intervention + Prettest,
                         random = "School", intervention = "Intervention",
                         nBoot = 1000, data = mstData)
plot(outputMSTBoot)
plot(outputMSTBoot,group=1)
#### Permutation
outputMSTPerm <- mstFREQ(Posttest~ Intervention + Prettest,
                         random = "School", intervention = "Intervention",
                         nPerm = 1000, data = mstData)
plot(outputMSTPerm)
plot(outputMSTPerm,group=1)
###############
##### CRT #####
###############
#### Random intercepts
outputCRT <- crtFREQ(Posttest~ Intervention + Prettest, random = "School",
                     intervention = "Intervention", data = crtData)
plot(outputCRT)
## Bootstrapped
outputCRTBoot <- crtFREQ(Posttest~ Intervention + Prettest, random = "School",
                         intervention = "Intervention", nBoot = 1000, data = crtData)
plot(outputCRTBoot,group=1)
##Permutation
outputCRTPerm <- crtFREQ(Posttest~ Intervention + Prettest, random = "School",
                         intervention = "Intervention", nPerm = 1000, data = crtData)
plot(outputCRTPerm,group=1)
}
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.