cusum_control: Calculate cusum control limits centred on target value or...

View source: R/cusum_control.R

cusum_controlR Documentation

Calculate cusum control limits centred on target value or mean

Description

Calculates cusum statistics and control limits based on input parameters. If no target value is supplied the mean of the x value will be used.

Usage

cusum_control(
  x,
  target = NULL,
  std_dev = NULL,
  desired_shift = 1,
  k = 0.5,
  h = 4
)

Arguments

x

input vector

target

target value for comparison, the mean of x will be used if missing

std_dev

Defaults to the screened moving range of x. A known or desired value for standard deviation can be supplied instead.

desired_shift

how many standard deviations do you want to detect? This value is typically between 0.5 to 1. Defaults to 1.

k

allowable slack - defaults to half the standard deviation multiplied by desired shift

h

action limits - usually between 4 and 5, defaults to 4. The standard deviation is multiplied by this value to determine the upper and lower limits on the chart

Value

data.frame showing original inputs and calculated control limits

Examples

test_vec3 <- c(1,1,2,3,5,7,11,7,5,7,8,9,5)
controls <- cusum_control(test_vec3, target = 4)



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