# NOT RUN {
# Example 1: Two variables (A default in control simulating dataset)
mydata=simoff()
# Example 2: Three variables and Inew=50 out of control batches
B1=matrix(c(-0.3,0,0.4,0,0.2,0,0,-0.1,0.5),3,byrow=TRUE)
B1new=matrix(c(0.1,0,0.4,0,0.2,0,0,-0.1,0.5),3,byrow=TRUE)
mydata1=simoff(n=100,I=100,size=3,Inew=50,B1,varcov=diag(3),B1new)
# Example 3: Three variables and Inew=1 new out of control batch
B1=matrix(c(-0.3,0,0.4,0,0.2,0,0,-0.1,0.5),3,byrow=TRUE)
B1new=matrix(c(0.1,0,0.4,0,0.2,0,0,-0.1,0.5),3,byrow=TRUE)
mydata2=simoff(n=100,I=100,size=3,Inew=1,B1,varcov=diag(3),B1new)
plot.ts(t(mydata2$data[1:3,]),main="One in control batch sample")
plot.ts(t(mydata2$newdata),main="One new batch sample")
# }
Run the code above in your browser using DataLab