rmultivariate-testingbaselinemsqc

Trouble adding a baseline to the mult.chart function in MSQC package (R) - any suggestions?


I need help with the mult.chart function from package MSQC in R. I searched and tried to add a baseline to the chart, but I was not able to do it.

Here is what I am trying to do:

library(MSQC)

variable1 <- 1:100
variable2 <- 1:100

data_MULTI <- data.frame(variable1 , variable2 )
baseline <- data_MULTI[1:21,]
mult.chart(type = "mewma", data_MULTI, baseline=baseline, lambda=0.4, alpha=0.05, method = "hm")

I also tried:

library(MSQC)

variable1 <- 1:100
variable2 <- 1:100

data_MULTI <- data.frame(variable1 , variable2 )
baseline <- data_MULTI[1:21,]
mult.chart(type = "mewma", data=baseline, newdata=data_MULTI[22:100], lambda=0.4, alpha=0.05, method = "hm")

None of these worked.

Do you know how I can add a baseline to these multivariate models?

I appreciate your help


Solution

  • The mult.chart function (MSQC package) does not have a "baseline" argument. I think that your incorrect result comes not from errors in the code, but from an incorrect approach to MSQC. Your baseline is Phase I, as in the official example:

    #Phase I
    
    data(carbon1)
    mult.chart(type = "t2", carbon)
    
    #Phase II
    
    Xmv <- mult.chart(carbon1, type = "t2") $Xmv
    S <- mult.chart(carbon1, type = "t2") $covariance
    colm <- nrow(carbon1)
    
    data(carbon2)
    mult.chart(carbon2, type = "t2", Xmv = Xmv, S = S, colm = colm)