CRTanalysis {CRTspat} R Documentation

## Analysis of cluster randomized trial with spillover

### Description

CRTanalysis carries out a statistical analysis of a cluster randomized trial (CRT).

### Usage

CRTanalysis(
trial,
method = "GEE",
distance = "nearestDiscord",
scale_par = NULL,
cfunc = "L",
numerator = "num",
denominator = "denom",
excludeBuffer = FALSE,
alpha = 0.05,
baselineOnly = FALSE,
baselineNumerator = "base_num",
baselineDenominator = "base_denom",
personalProtection = FALSE,
clusterEffects = TRUE,
spatialEffects = FALSE,
requireMesh = FALSE,
inla_mesh = NULL
)


### Arguments

trial

an object of class "CRTsp" or a data frame containing locations in (x,y) coordinates, cluster assignments (factor cluster), and arm assignments (factor arm) and outcome data (see details).

method

statistical method with options:

 "EMP" simple averages of the data "T" comparison of cluster means by t-test "GEE" Generalised Estimating Equations "LME4" Generalized Linear Mixed-Effects Models "INLA" Integrated Nested Laplace Approximation (INLA) "MCMC" Markov chain Monte Carlo using "JAGS" "WCA" Within cluster analysis
distance

Measure of distance or surround with options:

 "nearestDiscord" distance to nearest discordant location (km) "disc" disc "kern" surround based on sum of normal kernels "hdep" Tukey half space depth "sdep" simplicial depth
scale_par

numeric: pre-specified value of the spillover parameter or disc radius for models where this is fixed (cfunc = "R").

cfunc

transformation defining the spillover function with options:

 "Z" arm effects not considered reference model "X" spillover not modelled the only valid value of cfunc for methods "EMP", "T" and "GEE" "L" inverse logistic (sigmoid) the default for "INLA" and "MCMC" methods "P" inverse probit (error function) available with "INLA" and "MCMC" methods "S" piecewise linear only available with the "MCMC" method "E" estimation of scale factor only available with distance = "disc" or distance = "kern" "R" rescaled linear
link

link function with options:

 "logit" (the default). numerator has a binomial distribution with denominator denominator. "log" numerator is Poisson distributed with an offset of log(denominator). "cloglog" numerator is Bernoulli distributed with an offset of log(denominator). "identity" The outcome is numerator/denominator with a normally distributed error function.
numerator

string: name of numerator variable for outcome

denominator

string: name of denominator variable for outcome data (if present)

excludeBuffer

logical: indicator of whether any buffer zone (records with buffer=TRUE) should be excluded from analysis

alpha

numeric: confidence level for confidence intervals and credible intervals

baselineOnly

logical: indicator of whether required analysis is of effect size or of baseline only

baselineNumerator

string: name of numerator variable for baseline data (if present)

baselineDenominator

string: name of denominator variable for baseline data (if present)

personalProtection

logical: indicator of whether the model includes local effects with no spillover

clusterEffects

logical: indicator of whether the model includes cluster random effects

spatialEffects

logical: indicator of whether the model includes spatial random effects (available only for method = "INLA")

requireMesh

logical: indicator of whether spatial predictions are required (available only for method = "INLA")

inla_mesh

string: name of pre-existing INLA input object created by compute_mesh()

### Details

CRTanalysis is a wrapper for the statistical analysis packages: geepack, INLA, jagsUI, and the t.test function of package stats.

The wrapper does not provide an interface to the full functionality of these packages. It is specific for typical analyses of cluster randomized trials with geographical clustering. Further details are provided in the vignette.

The key results of the analyses can be extracted using a summary() of the output list. The model_object in the output list is the usual output from the statistical analysis routine, and can be also be inspected with summary(), or analysed using stats::fitted() for purposes of evaluation of model fit etc..

For models with a complementary log-log link function specified with link = "cloglog". the numerator must be coded as 0 or 1. Technically the binomial denominator is then 1. The value of denominator is used as a rate multiplier.

With the "INLA" and "MCMC" methods 'iid' random effects are used to model extra-Poisson variation.

Interval estimates for the coefficient of variation of the cluster level outcome are calculated using the method of Vangel (1996).

### Value

list of class CRTanalysis containing the following results of the analysis:

• description : description of the dataset

• method : statistical method

• pt_ests : point estimates

• int_ests : interval estimates

• model_object : object returned by the fitting routine

• spillover : function values and statistics describing the estimated spillover

### Examples