crtfreq -- Effect Size calculation for Cluster Randomised Trials

Syntax

crtfreq varlist [if] [in], intervention(interv_var) random(clust_var) [options]

main

intervention() requires a factor variable identifying the intervention (arms) of the trial.

random() requires a factor variable identifying the clusters (Schools) of the trial.

Model
ml fits model via maximum likelihood. Default is RMLE.

seed(#) seed number; default is 1020252.

nperm(#) number of permutations; default is NULL.

nboot(#) number of bootstraps; default is NULL.

case(# [#]) level of case bootstrap resampling with option to use both levels; default is 1.

residual residual bootstrap; default is case bootstrap.

percentile percentile confidence interval for bootstrap.

basic basic confidence interval for bootstrap; default is percentile.

* additional maximization options such as technique(), difficult, iterate().

Reporting
noisily displays the calculation of conditional models.

nodot suppresses display of dots; default is one dot character every 10 replications.

paste attaches bootstrapped/permutated effect sizes on the existing dataset.

varlist and intervention() may contain factor-variable operators; see fvvarlist.

Description

crtfreq Performs analysis of cluster randomised trials using a multilevel model under a frequentist setting.
This analysis produces Effect Size (ES) estimates for both conditional and unconditional model specifications. It also allows for sensitivity analysis options such as permutations
and bootstraps.

Options

Model

ml Calculates model using maximum likelihood estimation; default is Restricted Maximum Likelihood.

seed(#) Sets seed number for permutations/bootstraps.

nperm(#) Specifies number of permutations required to generate permutated p-values; see Stored results.
If specified with paste, a list of generated variables attaches to the user's dataset containing the permutated effect sizes.

nboot(#) Specifies number of bootstraps required to generate the bootstrap confidence intervals.
If specified with paste, a list of generated variables attaches to the user's dataset containing the bootstrapped effect sizes.

Note: When running bootstraps or permutations, use iterate() to reduce the maximum number of log-likelihood iterations in order to induce quicker failure in the event of non-convergence; Stata default is iterate(16000).
To identify non-convergence you can also specify the option noisily. Supplementary permutations/bootstraps are automatically deployed when # number of permutated/bootstrapped models have failed to converge.

case(# [#]) Specifies case bootstrap with a specific resampling structure. The numlist may take the value(s) of integers 1 and/or 2 indicating which level should be resampled with replacement from.
If case(1,2) is selected, then resampling will first take place at school level (2) followed by resampling at the pupil level (1); default is case(1).

residual Specifies type of bootstrap as the non-parametric residual bootstrap; default is case bootstrap.

percentile Specifies use of the percentile bootstrap confidence interval.

basic Specifies use of the basic (Hall's) bootstrap confidence interval; default is percentile.

* Additional maximization options are allowed including technique(), difficult, iterate() see [R] Maximize.

Reporting

noisily Displays the permutated/bootstrapped models' regression results.

nodot Suppresses display of dots indicating progress of permutations/bootstraps. Default is one dot character displayed for every block of 10 replications.

paste Attaches bootstrapped or permutated effect sizes to existing dataset if nperm (PermC/Unc_I#_W/T) or nboot (BootC/Unc_I#_W/T) has been specified,
where I# denotes number of interventions, C/Unc denotes Conditional and Unconditional estimates and W/T within and total effect sizes. Existing variables generated from previous use are replaced.

Examples

Setup:

. use crtData.dta, clear

Simple model:

. crtfreq Posttest Prettest, int(Intervention) ran(School)

Model using the case bootstrap using default bootstrap options, including if condition, additional maximization options and base level change:

. crtfreq Posttest Prettest if School!= 22, int(ib1.Intervention) ran(School) nboot(2000) iterate(100)

Model using permutations with three-arm intervention variable, maximum likelihood estimation and attaching permutated effect sizes to dataset:

. crtfreq Posttest Prettest, int(Intervention2) ran(School) nperm(3000) iterate(100) paste ml

Stored results

crtfreq stores the following in r():

Matrices

r(CondES#) conditional Hedges’ g effect size and its 95% confidence intervals for # number of arms in interv_var. If nboot is specified, CIs are replaced with bootstrapped CIs.

r(UncondES#) unconditional effect size for # number of arms in interv_var, obtained based on variances from the unconditional model (model with only the intercept as a fixed effect).

r(Beta) estimates and confidence intervals for variables specified in the model.

r(Cov) variance decomposition into between cluster variance (Schools), within cluster variance (Pupils) and Total variance. It also contains intra-cluster correlation (ICC).

r(SchEffects) estimated deviation of each school from the intercept and intervention slope.

r(CondPv) conditional two-sided within and total effect size permutation p-values (available if nperm(#) has been selected).

r(UncondPv) unconditional two-sided within and total effect size permutation p-values (available if nperm(#) has been selected).