# Loading sample data
data(mwa_data)
# Specify required parameters:
# - 2 to 10 days in steps of 2
t_window <- c(2,10,2)
# - 2 to 10 kilometers in steps of 2
spat_window <- c(2,10,2)
# - column and entries that indicate treatment events
treatment <- c("type","treatment")
# - column and entries that indicate control events
control <- c("type","control")
# - column and entries that indicate dependent events
dependent <- c("type","dependent")
# - columns to match on
matchColumns <- c("match1","match2")
# Specify optional parameters:
# - use weighted regression (default estimation method is "lm")
weighted <- TRUE
# - temporal units
t_unit <- "days"
# - match on counts of previous treatment and control events
TCM <- TRUE
# \donttest{
# Execute method:
results <- matchedwake(mwa_data, t_window, spat_window, treatment, control, dependent,
matchColumns, weighted = weighted, t_unit = t_unit, TCM = TCM)
# Plot results:
plot(results)
# Return detailed summary of results:
summary(results, detailed = TRUE)
# }
Run the code above in your browser using DataLab