# NOT RUN {
## make a SIMCA model for Iris setosa class and show results for calibration set
library(mdatools)
data = iris[, 1:4]
class = iris[, 5]
# take first 30 objects of setosa as calibration set
se = data[1:30, ]
# make SIMCA model and apply to test set
model = simca(se, 'Se')
model = selectCompNum(model, 1)
# show infromation and summary
print(model$calres)
summary(model$calres)
# show plots
layout(matrix(c(1,1,2,3), 2, 2, byrow = TRUE))
plotPredictions(model$calres, show.labels = TRUE)
plotResiduals(model$calres, show.labels = TRUE)
plotPerformance(model$calres, show.labels = TRUE, legend.position = 'bottomright')
layout(1, 1, 1)
# show predictions table
showPredictions(model$calres)
# }
Run the code above in your browser using DataLab