CRTanalysis {CRTspat} | R Documentation |
CRTanalysis
carries out a statistical analysis of a cluster randomized trial (CRT).
CRTanalysis(
trial,
method = "GEE",
distance = "nearestDiscord",
scale_par = NULL,
cfunc = "L",
link = "logit",
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
)
trial |
an object of class | |||||||||||||||||||||||||||||
method |
statistical method with options:
| |||||||||||||||||||||||||||||
distance |
Measure of distance or surround with options:
| |||||||||||||||||||||||||||||
scale_par |
numeric: pre-specified value of the spillover parameter or disc radius for models where this is fixed ( | |||||||||||||||||||||||||||||
cfunc |
transformation defining the spillover function with options:
| |||||||||||||||||||||||||||||
link |
link function with options:
| |||||||||||||||||||||||||||||
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 | |||||||||||||||||||||||||||||
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 | |||||||||||||||||||||||||||||
requireMesh |
logical: indicator of whether spatial predictions are required
(available only for | |||||||||||||||||||||||||||||
inla_mesh |
string: name of pre-existing INLA input object created by |
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).
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
example <- readdata('exampleCRT.txt')
# Analysis of test dataset by t-test
exampleT <- CRTanalysis(example, method = "T")
summary(exampleT)
# Standard GEE analysis of test dataset ignoring spillover
exampleGEE <- CRTanalysis(example, method = "GEE")
summary(exampleGEE)
# LME4 analysis with error function spillover function
exampleLME4 <- CRTanalysis(example, method = "LME4", cfunc = "P")
summary(exampleLME4)