crtFREQ {eefAnalytics}R Documentation

Analysis of Cluster Randomised Education Trials using Multilevel Model under a Frequentist Setting.

Description

crtFREQ performs analysis of cluster randomised education trials using a multilevel model under a frequentist setting.

Usage

crtFREQ(
  formula,
  random,
  intervention,
  baseln,
  nPerm,
  nBoot,
  type,
  ci,
  seed,
  data
)

Arguments

formula

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

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 appearing in the formula and the data. See example below.

baseln

A string variable allowing the user to specify the reference category for intervention variable. When not specified, the first level will be used as a reference.

nPerm

number of permutations required to generate a permutated p-value.

nBoot

number of bootstraps required to generate bootstrap confidence intervals.

type

method of bootstrapping including case re-sampling at student level "case(1)", case re-sampling at school level "case(2)", case re-sampling at both levels "case(1,2)" and residual bootstrapping using "residual". If not provided, default will be case re-sampling at student level.

ci

method for bootstrap confidence interval calculations; options are the Basic (Hall's) confidence interval "basic" or the simple percentile confidence interval "percentile". If not provided default will be percentile.

seed

seed required for bootstrapping and permutation procedure, if not provided default seed will be used.

data

data frame containing the data to be analysed.

Value

S3 object; a list consisting of

Examples

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 residual bootstrap confidence intervals ##
##################################################

output2 <- crtFREQ(Posttest~ Intervention+Prettest,random="School",
		intervention="Intervention",nBoot=1000,type="residual",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)
}

[Package eefAnalytics version 1.1.1 Index]