plot_JoinCount: plot_JoinCount

Description Usage Arguments Value Examples

View source: R/plots.R

Description

Uses Join Count tests to assess spatial clustering or dispersion of categorical variables in the data. Negative values indicate positive spatial clustering.

Usage

1
2
3
4
5
6
7
8
9
plot_JoinCount(
  data,
  var_cured = character(),
  var_id = character(),
  var_time = character(),
  n = 1,
  t = 1.645,
  threshold = 800L
)

Arguments

data

data.

var_cured

binary indicator of immunity.

var_id

ID's unique identifier.

var_time

variable that measures time.

n

number of observation per id.

t

value of the confidence interval.

threshold

distance in kilometers. By default is 800.

Value

A ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(BayesSPsurv)
dataw  <- spduration::add_duration(data = BayesSPsurv::Walter_2015_JCR,
                                   y = "renewed_war",
                                   unitID = "ccode",
                                   tID = "year",
                                   freq = "year",
                                   ongoing = FALSE)


plot_JoinCount(data = dataw,
               var_cured = "cured",
               var_id = "ccode",
               var_time = "year",
               n = 12)

Nicolas-Schmidt/BayesSPsurv documentation built on Sept. 17, 2021, 8:51 a.m.