cusum_single_median: Calculates the cumulative sum statistic relative to target,...

View source: R/cusum_single_median.R

cusum_single_medianR Documentation

Calculates the cumulative sum statistic relative to target, or median value

Description

Calculates the cumulative sum statistic of a vector of values, centred on either the median of the data, or a supplied target value.

Usage

cusum_single_median(x, target = NULL)

Arguments

x

a numeric vector from which to calculate the cumulative sum statistics

target

value to compare each element of x to. If not provided, the median value of x will be calculated and used as a target value

Value

a vector of the cumulative sum statistic, centred on the target value

Examples


test_vec <- c(0.175, 0.152, 0.15, 0.207, 0.136, 0.212, 0.166)
cusum_single_median(test_vec)


johnmackintosh/cusumcharter documentation built on Nov. 24, 2024, 3:50 p.m.