rsp: Distribution-Free Phase I Analysis of Univariate Data based...

View source: R/rsp.R

rspR Documentation

Distribution-Free Phase I Analysis of Univariate Data based on Recursive Segmentation and Permutation

Description

rsp implements the Phase I method described in Capizzi and Masarotto (2013).

Usage

rsp(y, plot = TRUE, L = 1000, seed = 11642257, alpha = 0.05,
    maxsteps = min(50, round(NROW(y)/15)), lmin = max(5, min(10, round(NROW(y)/10))))

Arguments

y

Phase I data; y can be either (i) a vector or a 1xm matrix in the case of individual observations or (ii) a nxm matrix for subgrouped data (n observations gathered at m time points).

plot

logical; if TRUE, the diagnostic plot is displayed.

L

integer; the number of random permutations used to compute the p-values.

seed

positive integer; if not NA, the RNG's state is resetted using seed. The current .Random.seed will be preserved.

alpha

real; the significance level used to compute the level and scale estimates; if one of the p-values is greater than alpha, the corresponding estimate is a constant.

maxsteps

integer; the maximum number of step shifts which the procedure tries to detect.

lmin

integer; the minimum length of a step.

Value

A list with elements

p

the adjusted p-values

stat

the summary statistics (a mx2 matrix)

fitted

the (possibly time-variant) estimates of the process level and scale (a mx2 matrix).

Author(s)

Giovanna Capizzi and Guido Masarotto.

References

G. Capizzi, G. Masarotto (2013), “Phase I Distribution-Free Analysis of Univariate Data”. Journal of Quality Technology, 45, pp. 273-284, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/00224065.2013.11917938")}.

Examples

# Individual observations with a transient level change
set.seed(112233)
level <- c(rep(0,20),rep(3,10),rep(0,20))
x <- level+rt(50,4)
rsp(x)
# Individual observations with a scale step change
scale <- c(rep(1,25),rep(3,25))
x <- scale*rt(50,4)
rsp(x)
data(fe)
rsp(fe)
data(colonscopy)
rsp(colonscopy)

dfphase1 documentation built on July 9, 2023, 7:29 p.m.