crtFREQ: Analysis of Cluster Randomised Education Trials using...

Description Usage Arguments Value Examples

View source: R/eefAnalytics_03_2017.r

Description

crtFREQ performs Analysis of cluster randomised education trial using multilevel model under the frequentist framework.

Usage

1
crtFREQ(formula, random, intervention, nPerm = NULL, nBoot = NULL, data)

Arguments

formula

the model to be analysed. It is of the form y ~ x1+x2+.... Where y is the outcome variable and Xs are the predictors.

random

a string variable specifying the "clustering variable" as contained in the data. See example below

intervention

a string variable specifying the "intervention variable" as appeared in the formula. See example below

nPerm

number of permutations required to generate permutated p-value. Default is NULL.

nBoot

number of bootstraps required to generate bootstrap confidence interval. Default is NULL.

data

data frame containing the data to be analysed.

Value

S3 object; a list consisting of

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

data(crtData)

########################################################
## MLM analysis of cluster randomised trials + 1.96SE ##
########################################################

output1 <- crtFREQ(Posttest~ Intervention+Prettest,random="School",
		intervention="Intervention",data=crtData)


### Fixed effects
beta <- output1$Beta
beta

### Effect size
ES1 <- output1$ES
ES1

## Covariance matrix
covParm <- output1$covParm
covParm

### plot random effects for schools

plot(output1)

###############################################
## MLM analysis of cluster randomised trials ##	 
## with bootstrap confidence intervals       ##
###############################################

output2 <- crtFREQ(Posttest~ Intervention+Prettest,random="School",
		intervention="Intervention",nBoot=1000,data=crtData)


### Effect size

ES2 <- output2$ES
ES2

### plot bootstrapped values

plot(output2, group=1)

#######################################################################
## MLM analysis of cluster randomised trials with permutation p-value##
#######################################################################

output3 <- crtFREQ(Posttest~ Intervention+Prettest,random="School",
		intervention="Intervention",nPerm=1000,data=crtData)

### Effect size

ES3 <- output3$ES
ES3


### plot permutated values

plot(output3, group=1)
}

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