# NOT RUN {
strDates <- c("2000-01-01", "2000-01-02", "2000-01-03", "2000-01-04", "2000-01-05")
ts <- cenTS(value=c(1,-2,1,NA,0),
order.by=as.Date(strDates,"%Y-%m-%d"),
lcl=c(-3,-2,-1,-1,0),
ucl=c(3,2,1,1,1),
x=c(1,1,1,1,1),
y=c(2,2,2,2,2))
print(ts)
print(xreg(ts))
plot(ts)
# }
# NOT RUN {
#wrong call, case 1
ts <- cenTS(value=c(1,-2,1,NA,0),
order.by=as.Date(strDates,"%Y-%m-%d"),
lcl=c(-3,-2,-1,-1,0),
ucl=c(3,2,1,1,1),
ci =c(-1,-1,1,NA,-1)
)
#wrong call, case 2
ts <- cenTS(value=c(1,-2,1,NA,0),
order.by=as.Date(strDates,"%Y-%m-%d"),
lcl=c(-3,-2,-1,-1,0),
ucl=c(3,2,1,1,1),
ci =c(1,-1,1,NA,-1)
)
#wrong call, case 3
ts <- cenTS(value=c(1,-2,1,NA,0),
order.by=as.Date(strDates,"%Y-%m-%d"),
lcl=c(-3,-2,-1,-1,0),
ucl=c(3,2,1,1,1),
ci =c(0,-1,0,NA,-1)
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab