# NOT RUN {
library(SCGLR)
# load sample data
data(genus)
# get variable names from dataset
n <- names(genus)
n <-n[!n%in%c("geology","surface","lon","lat","forest","altitude")]
ny <- n[grep("^gen",n)] # Y <- names that begins with "gen"
nx1 <- n[grep("^evi",n)] # X <- remaining names
nx2 <- n[-c(grep("^evi",n),grep("^gen",n))]
form <- multivariateFormula(ny,nx1,nx2,A=c("geology"))
fam <- rep("poisson",length(ny))
testcv <- scglrThemeBackward(form,data=genus,H=c(2,2),family=fam,offset = genus$surface,kfolds=2)
Cross-validation pathway
testcv$H_path
Plot criterion
plot(testcv$cv_path)
Best combination
testcv$H_best
# }
Run the code above in your browser using DataLab