plot.eefAnalytics: A plot method for the an eefAnalytics S3 object obtained from...

Description Usage Arguments Details Value Examples

View source: R/plotfunctions.R

Description

plots different figures based on output from eefAnalytics package.

Usage

1
2
## S3 method for class 'eefAnalytics'
plot(x, group = NULL, ...)

Arguments

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

Details

Plot produces graphical visualisation depending on which model is fitted:

Value

Returns relevant plots for each model.

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

eefAnalytics documentation built on May 31, 2017, 4:17 a.m.