Learn R Programming

spcadjust (version 0.9)

SPCCUSUMlm-class: Class "SPCCUSUMlm"

Description

Risk-adjusted CUSUM chart based on a linear model.

Arguments

Objects from the Class

Objects can be created by calls of the form new("SPCCUSUMlm", ...).

Extends

Class "SPCCUSUMNonpar", directly. Class "SPCCUSUM", by class "SPCCUSUMNonpar", distance 2. Class "SPCchart", by class "SPCCUSUMNonpar", distance 3.

Examples

Run this code
n <- 1000
Xlinreg <- data.frame(x1= rbinom(n,1,0.4), x2= runif(n,0,1), x3= rnorm(n))
Xlinreg$y <- 2 + Xlinreg$x1 + Xlinreg$x2 + Xlinreg$x3 + rnorm(n)

chartlinreg <- new("SPCCUSUMlm",Delta=1,formula="y~x1+x2+x3")
#increase nrep in real applications
SPCproperty(data=Xlinreg,
            nrep=10,
            property=new("calARLCUSUM",chart=chartlinreg,target=100))
chartlinreg2 <- new("SPCCUSUMlm",Delta=1,formula="y~x1")
#increase nrep in real applications
SPCproperty(data=Xlinreg,
            nrep=10,
            property=new("calARLCUSUM",chart=chartlinreg2,target=100))

Run the code above in your browser using DataLab