# NOT RUN {
## load some data
data(beetles)
data(plants)
## log transform the bettle data
beetles <- log(beetles + 1)
## predictive CoCA using SIMPLS and formula interface
bp.pred <- coca(beetles ~ ., data = plants)
## should retain only the useful PLS components for a parsimonious model
# }
# NOT RUN {
## Leave-one-out crossvalidation - this takes a while
crossval(beetles, plants)
## so 2 axes are sufficient
# }
# NOT RUN {
## permutation test
## (Testing the first 2 axes & only 50 perms for speed.)
bp.perm <- permutest(bp.pred, permutations = 50, n.axes = 2)
bp.perm
# }
Run the code above in your browser using DataLab