Learn R Programming

vMask (version 1.0)

vMask.method4: Method 4 for V-Mask Implementation: Using \(\mu0\), \(k\), \(h\) and \(w\)

Description

The V-mask method in vMask Package, is considered on the basis of variety of situations/information by different functions. One of these functions is vMask.method1 which can plot the V-mask based on \(\mu_0\), \(k\) and \(h\) and \(w\).

Usage

vMask.method4(data, mu0 = mean(data), k = 0.5 * sd(data), h = 5 * sd(data), 
w = 2 * sd(data), sleep = 1)

Arguments

data

Type of inputted data must be a matrix with \(dim=c(m,n)\), in which \(m\) is size of samples and \(n\) is size of each subsample. Meanwhile, data can be a numerical vector where its elements are sub-sample means.

mu0

The target value for process mean, with default mean(data).

k

With default \(0.5 \sigma\) and it depends on the form of the alternative hypothesis \(H_1: \mu = \mu_1 \ (\mu_1=\mu_0+k \sigma)\).

h

The length of decision making (\(h\)) is equal to the vertical distance between the origin and the upper (or lower) arm of V-mask. Its default is \(h = 5 sd(data)\), since usually \(h \in [4.5 \sigma, 5 \sigma]\) is proposed.

w

The ration of vertical unit into horizontal unit in CUSUM plot, with default \(w = 2 \times sd(data)\) (this default causes \(\theta\) to be approximately equal to 14 degrees).

sleep

Sleeping time (in second) of the program between showing figures. This time needs for see the result of checking \(i\)-th point on CUSUM control chart by V-mask. Also, if sleep="PressEnter", then the user must press key [Enter] in 'R Console' window to continue/check the next cumulative summation point on chart with V-mask.

Value

d

The distance between two following points: (1) \(O\), i.e. the latest cumulative sum point (which duty of the V-mask is checking this point), and (2) \(P\), i.e. the junction points of V-mask arms.

theta

half of the angle formed by the V-mask arms (in degrees).

h

the vertical distance between the origin and the upper (or lower) arm of V-mask.

c

A vector of the cumulative differences between statistic (mean) values and the mean target value; i.e. \(c=(c_1, ..., c_m)\) where \(c_i=\sum_{j=1}^{i} (\bar{x}_j - \mu_0) \).

OutControl

The number of Out-of-control points in CUSUM chart.

InControl

The number of In-control points in CUSUM chart.

See Also

vMask.method3

Examples

Run this code
# NOT RUN {
m = 35	#The size of samples
n = 2 	#The size of each subsample
set.seed(1234)
Data = matrix(rnorm(m*n, 0,1), nrow=m)
head(Data)

vMask.method4( data=Data, s=0 )
vMask.method4( data=Data, k=.3, h=2.5, w=1, s=0 )
vMask.method4( data=Data, k=.3, h=2.5, w=2, s=0 ) #Compare with the previous line
# }

Run the code above in your browser using DataLab