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 value indicating which intervention to plot. This must not be greater than the number of intervention excluding the control group. For a two arm trial, the maximum value is 1 and a maximum value of 2 for three arm trial. |
... |
arguments passed to |
Plot produces 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 boostrapped 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.
For mlmBayes()
, plot produces the distrbution of random intercepts when group = NULL
.
It produces the probability of effect size to be greater than a pre-specified threshold when group is specified.
Lastly, plot produces forest plots to compare CACE estimated for different level of compliance when caceSRTBoot()
or
caceCRTBoot()
or caceMSTBoot()
is used.
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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | 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)
####################
##### Bayesian #####
####################
outputMSTbayes <- mlmBayes(Posttest~ Intervention + Prettest,
random = "School", intervention = "Intervention",
nSim = 10000, data = mstData)
## Random intercepts
plot(outputMSTbayes)
## Probability of effect size greater than a precified threshold
plot(outputMSTbayes,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)
## Bayesain
outputCRTbayes <- mlmBayes(Posttest~ Intervention + Prettest, random = "School",
intervention = "Intervention", nSim = 10000, data = crtData)
plot(outputCRTbayes,group=1)
################
##### CACE #####
################
outputSRTCace <- caceSRTBoot(Posttest~ Intervention + Prettest,
intervention = "Intervention",compliance="Percentage_Attendance",
nBoot=1000, data = mstData)
plot(outputSRTCace)
outputMSTCace <- caceMSTBoot(Posttest~ Intervention + Prettest,random="School",
intervention = "Intervention",compliance="Percentage_Attendance",
nBoot=1000, data = mstData)
plot(outputMSTCace)
outputCRTCace <- caceCRTBoot(Posttest~ Intervention + Prettest,random="School",
intervention = "Intervention",compliance="Percentage_Attendance",
nBoot=1000, data = crtData)
plot(outputCRTCace)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.