cusum_single_df: Cumulative sum statistics and variances, centred on target...

View source: R/cusum_single_df.R

cusum_single_dfR Documentation

Cumulative sum statistics and variances, centred on target value or mean

Description

Provides substantially more information than cusum_single. Outputs a data.frame with the original values, target, the variance, the cumulative sum of the variance, and the cumulative sum centered on the target value. This centering is achieved by adding the target value to the cumulative sum.

Usage

cusum_single_df(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 mean of x will be calculated and used as a target value

Value

a dataframe with the original values, target, the variance, the cumulative sum of the variance, and the cumulative sum centered on the target value. This centering is achieved by adding the target value to the cumulative sum.

Examples


test_vec <- c(0.175, 0.152, 0.15, 0.207, 0.136, 0.212, 0.166)
cusum_single_df(test_vec, target = 0.16)



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