# NOT RUN {
###############
## NDVI: ndvi_40
###############
## define elements orders of categorical variables
cz <- c("Bwk","Bsk","Dwa","Dwb","Dwc") ## climate zone
mp <- c("very low","low","medium","high","very high") ## mining production
ndvi_40$Climatezone <- as.numeric(1:5)[match(ndvi_40$Climatezone, cz)]
ndvi_40$Mining <- as.numeric(1:5)[match(ndvi_40$Mining, mp)]
## set optional parameters of optimal discretization
## optional methods: equal, natural, quantile, geometric, sd and manual
discmethod <- c("equal","natural","quantile")
discitv <- c(4:6)
## "gdm" function
ndvigdm <- gdm(NDVIchange ~ Climatezone + Mining + Tempchange + GDP,
continuous_variable = c("Tempchange", "GDP"),
data = ndvi_40,
discmethod = discmethod, discitv = discitv)
ndvigdm
# plot(ndvigdm)
# }
# NOT RUN {
#############
## H1N1: h1n1_100
#############
## set optional parameters of optimal discretization
discmethod <- c("equal","natural","quantile")
discitv <- c(4:6)
continuous_variable <- colnames(h1n1_100)[-c(1,11)]
## "gdm" function
h1n1gdm <- gdm(H1N1 ~ .,
continuous_variable = continuous_variable,
data = h1n1_100,
discmethod = discmethod, discitv = discitv)
h1n1gdm
plot(h1n1gdm)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab