# the PRC process for the first application in
# "Design and properties of the Predictive Ratio Cusum (PRC) control charts"
### CD: Current data (New reagent)
### HD: Historical data (Previous reagent)
CD <- c( 31.0, 30.0, 32.0, 28.0, 33.2, 33.2, 35.1, 35.1, 33.9, 37.9,
33.2, 36.5, 33.2, 35.1, 34.5, 36.5, 33.2, 35.1, 37.2, 32.6, 36.5 )
HD <- c( 31, 30, 33, 30, 33, 30, 31, 32, 32, 30, 33, 31, 34, 31, 34, 34, 36, 30,
33, 29, 34, 32, 32, 28, 34, 32, 32, 30, 31, 29, 31, 29, 31, 32,34,34,32 )
N <- length(CD)
n0 <- length(HD)
### initial prior parameters
M0F <- 31.8
LF <- 1/2
AF <- 2
BF <- 2.1^2
norm_mean2_PRC( data = CD, historical_data = HD, alpha_0 = 1/n0, mu0 = M0F,
l0 = LF, a0 = AF, b0 = BF, h = 3.749, two.sided = TRUE )
### a real data application to aPTT values
### CURRENT DATA aPTT
CD <- c( 29.0, 29.1, 28.7, 28.2, 28.0, 29.1, 28.6, 28.7, 28.6, 29.0, 28.4,
28.1, 28.8, 29.7, 28.8, 29.8, 28.8, 29.4, 28.4, 28.7, 28.7, 29.5,
28.5, 28.4, 28.1, 28.6, 28.2, 29.6, 28.9, 29.1, 29.0, 29.9, 28.6,
29.3, 28.2, 28.6, 27.6, 27.3, 28.7, 27.2, 28.4, 28.0, 28.4, 27.8,
28.4, 28.4, 27.7, 29.2, 27.5, 27.7)
### HISTORICAL DATA aPTT
HD <- c( 28.0, 28.9, 27.7, 29.3, 28.9, 29.5, 28.2, 27.5, 28.8, 28.9, 28.7,
27.4, 28.6, 28.5, 29.6, 28.7, 21.3, 29.4, 28.1, 28.9, 28.3, 27.6,
29.0, 29.2, 27.8, 29.1, 28.9, 29.4, 29.4, 28.9, 28.9, 29.2, 29.4,
29.4, 28.1, 28.5, 29.7, 29.3, 28.6, 29.2, 29.3, 29.3, 29.3, 30.0,
29.1, 29.1, 26.8, 29.0, 29.3, 28.3)
norm_mean2_PRC( data = CD, historical_data = HD, mu0 = 28.9,
l0 = 1/4, a0 = 2, b0 = 0.49, two.sided = TRUE )
Run the code above in your browser using DataLab