matchdist: matchdist function

View source: R/matchdist.R

matchdistR Documentation

matchdist function

Description

This function matches exposed units and unexposed units by a pre-specified buffer distance (Euclidean distance)

Usage

matchdist(
  data,
  bexp,
  long,
  lat,
  exp.status = 1,
  distbuf = 0.1,
  exp.included = TRUE,
  replace = TRUE
)

Arguments

data

a dataset object.

bexp

a character string indicating the name of the binary exposure. Use apostrophe like "VariableName"

long

a character string indicating the name of the longitude variable of observation units

lat

a character string indicating the name of the latitude variable of observation units

exp.status

a numeric vector indicating the value indicating exposed units. Defalut=1

distbuf

a numeric vector indicating the buffer distance by which exposed units and unexposed units are matched

exp.included

an indicator of whether exposed units are matched with not only unexposed units but also other exposed units. Defalut is TRUE. If FALSE, exposed units are matched with only unexposed units. See details

replace

an indicator of whether matching is done with replacement. Default is TRUE. If FALSE, matching is done without replacement. If FALSE, note that the output of this function may differ by the order of observation units in the original dataset.

Examples

matchdist()

HonghyokKim/CGPSspatialmatch documentation built on April 24, 2022, 9:10 p.m.