# \donttest{
###############################################################
## Examples from Schauberger and Tutz (2020)
## Data from the German Longitudinal Election Study (GLES) 2017
###############################################################
####
## Source: German Longitudinal Election Study 2017
## Rossteutscher et al. 2017, https://doi.org/10.4232/1.12927
####
## load GLES data
data(GLES17)
## scale data
GLES17[,7:11] <- scale(GLES17[,7:11])
## define formula
f.GLES <- as.formula(cbind(RefugeeCrisis, ClimateChange, Terrorism,
Globalization, Turkey, NuclearEnergy) ~
Age + Gender + Unemployment + EastWest + Abitur)
## fit adjacent categories model without and with response style parameters
m.GLES0 <- multordRS(f.GLES, data = GLES17, control = ctrl.multordRS(RS = FALSE, cores = 6))
m.GLES <- multordRS(f.GLES, data = GLES17, control = ctrl.multordRS(cores = 6))
m.GLES0
m.GLES
plot(m.GLES, main = "Adjacent categories model")
## fit cumulative model without and with response style parameters (takes pretty long!!!)
m.GLES20 <- multordRS(f.GLES, data = GLES17, model="cumul",
control = ctrl.multordRS(opt.method = "nlminb", cores = 6, RS = FALSE))
m.GLES2 <- multordRS(f.GLES, data = GLES17, model="cumul",
control = ctrl.multordRS(opt.method = "nlminb", cores = 6))
m.GLES20
m.GLES2
plot(m.GLES2, main = "Cumulative model")
# }
Run the code above in your browser using DataLab