test_veris_time_stability: Determine if the enumeration is changing over time

View source: R/ci.R

test_veris_time_stabilityR Documentation

Determine if the enumeration is changing over time

Description

This is used by analyzing a dataset over time for an enumeration. It functions by fitting a straight line to the values and checking if the confidence interval on the slope contains zero.

Usage

test_veris_time_stability(
  chunk,
  Ea,
  stable = NULL,
  direction = NULL,
  quietly = FALSE,
  visualize = FALSE
)

Arguments

chunk

getenumCI() object

Ea

Enumeration A. e.g. "Error"

stable

DEPRECIATED. USE 'direction="equal"'. TRUE means "hypothesis is 'not changing'". FALSE means "hypothesis is 'changing'"

direction

"greater" for increasing, "less" for decreasing, "equal" for "not changing"

quietly

do not produce textual output

visualize

produce visual output

Details

Technically instead of 'true/false', the language should really be along the lines of "we have evidence for the alternative hypothesis ..." or "we do not have evidence to go against our original null hypothesis ...", but for simplicity we have left it the way it is.

Value

a logical TRUE/FALSE to the hypothesis

Examples

## Not run: 
tmp <- tempfile(fileext = ".dat")
download.file("https://github.com/vz-risk/VCDB/raw/master/data/verisr/vcdb.dat", tmp, quiet=TRUE)
load(tmp, verbose=TRUE)
chunk <- vcdb %>%
  filter(timeline.incident.year %in% 2015:2020) %>%
  filter(attribute.confidentiality.data_disclosure.Yes) %>%
  verisr::getenumCI2020("pattern.Lost and Stolen Assets", 
    by="plus.dbir_year", 
    ci.method="bootstrap", force= TRUE) %>%
  filter(!is.na(n))
  
  chunk
  
  verisr::test_veris_time_stability(chunk, "Lost and Stolen Assets", stable=TRUE)

## End(Not run)

vz-risk/verisr documentation built on Aug. 5, 2023, 4:34 a.m.