specify_buffer {CRTspat}R Documentation

Specification of buffer zone in a cluster randomized trial

Description

specify_buffer specifies a buffer zone in a cluster randomized trial (CRT) by flagging those locations that are within a defined distance of those in the opposite arm.

Usage

specify_buffer(trial, buffer_width = 0)

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).

buffer_width

minimum distance between locations in opposing arms for them to qualify to be included in the core area (km)

Value

A list of class "CRTsp" containing the following components:

geom_full list: summary statistics describing the site, cluster assignments, and randomization.
geom_core list: summary statistics describing the core area
trial data frame: rows correspond to geolocated points, as follows:
x numeric vector: x-coordinates of locations
y numeric vector: y-coordinates of locations
cluster factor: assignments to cluster of each location
arm factor: assignments to "control" or "intervention" for each location
nearestDiscord numeric vector: signed Euclidean distance to nearest discordant location (km)
buffer logical: indicator of whether the point is within the buffer
... other objects included in the input "CRTsp" object or data frame

Examples

#Specify a buffer of 200m
exampletrial <- specify_buffer(trial = readdata('exampleCRT.txt'), buffer_width = 0.2)

[Package CRTspat version 1.3.0 Index]