multordRS: Model Multivariate Ordinal Responses Including Response...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/MultOrdRS.R

Description

A model for multivariate ordinal responses. The response is modelled using a mixed model approach that is also capable of the inclusion of response style effects of the respondents.

Usage

1
2
3
4
5
6
7
multordRS(
  formula,
  data = NULL,
  control = ctrl.multordRS(),
  se = TRUE,
  model = c("acat", "cumulative")
)

Arguments

formula

Formula containing the (multivariate) ordinal response on the left side and the explanatory variables on the right side.

data

Data frame containing the ordinal responses as well as the explanatory variables from the formula.

control

Control argument for multord() function. For details see ctrl.multordRS.

se

Should standard errors be calculated for the regression coefficients? Default is TRUE.

model

Specifies, which type of model is used, either the (multivariate) adjacent categories model (model = "acat") or the (multivariate) cumulative model (model = "cumulative").

Value

beta.thresh

Matrix containing all threshold parameters for the respective model.

beta.shift

Vector containing all shift parameters. Only relevant if model = "acat" and thresholds.acat = "shift".

beta.X

Vector containing parameter estimates for the location effects of the explanatory variables.

beta.XRS

Vector containing parameter estimates for the response style effects of the explanatory variables.

Sigma

Estimate of the variance (or covariance matrix) of the random effects. The estimate is a matrix if person-specific random response style effects are considered in the model (i.e. if RS = TRUE).

Y

Matrix containing the explanatory variables.

X

Data frame containing the multivariate ordinal response, one row per obeservation, one column per response variable.

se.thresh

Matrix containing all standard errors of the threshold parameters for the respective model.

se.shift

Vector containing all standard errors of the shift parameters. Only relevant if model = "acat" and thresholds.acat = "shift".

se.X

Vector containing standard errors of the parameter estimates for the location effects of the explanatory variables.

se.XRS

Vector containing standard errors of the parameter estimates for the response style effects of the explanatory variables.

coef.vec

Complete vector of all parameter estimates (for internal use).

se.vec

Complete vector of all standard errors (for internal use).

design.values

Some values of the design matrix (for internal use).

loglik

(Marginal) Log Likelihood

call

Function call

df

Degrees of freedom

control

Control argument from function call

Author(s)

Gunther Schauberger
gunther.schauberger@tum.de
https://orcid.org/0000-0002-0392-1580

References

Schauberger, Gunther and Tutz, Gerhard (2021): Multivariate Ordinal Random Effects Models Including Subject and Group Specific Response Style Effects, Statistical Modelling, https://journals.sagepub.com/doi/10.1177/1471082X20978034

See Also

ctrl.multordRS MultOrdRS-package plot.MultOrdRS

Examples

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
data(tenseness)

## create a small subset of the data to speed up calculations
set.seed(1860)
tenseness <- tenseness[sample(1:nrow(tenseness), 300),]

## scale all metric variables to get comparable parameter estimates
tenseness$Age <- scale(tenseness$Age)
tenseness$Income <- scale(tenseness$Income)

## two formulas, one without and one with explanatory variables (gender and age)
f.tense0 <- as.formula(paste("cbind(",paste(names(tenseness)[1:4],collapse=","),") ~ 1"))
f.tense1 <- as.formula(paste("cbind(",paste(names(tenseness)[1:4],collapse=","),") ~ Gender + Age"))



####
## Adjacent Categories Models
####

## Multivariate adjacent categories model, without response style, without explanatory variables
m.tense0 <- multordRS(f.tense0, data = tenseness, control = ctrl.multordRS(RS = FALSE, cores = 2))
m.tense0



## Multivariate adjacent categories model, with response style as a random effect, 
## without explanatory variables
m.tense1 <- multordRS(f.tense0, data = tenseness)
m.tense1

## Multivariate adjacent categories model, with response style as a random effect, 
## without explanatory variables for response style BUT for location
m.tense2 <- multordRS(f.tense1, data = tenseness, control = ctrl.multordRS(XforRS = FALSE))
m.tense2

## Multivariate adjacent categories model, with response style as a random effect, with 
## explanatory variables for location AND response style
m.tense3 <- multordRS(f.tense1, data = tenseness)
m.tense3

plot(m.tense3)



####
## Cumulative Models
####

## Multivariate cumulative model, without response style, without explanatory variables
m.tense0.cumul <- multordRS(f.tense0, data = tenseness, control = ctrl.multordRS(RS = FALSE), 
  model = "cumulative")
m.tense0.cumul

## Multivariate cumulative model, with response style as a random effect, 
## without explanatory variables
m.tense1.cumul <- multordRS(f.tense0, data = tenseness, model = "cumulative")
m.tense1.cumul

## Multivariate cumulative model, with response style as a random effect, 
## without explanatory variables for response style BUT for location
m.tense2.cumul <- multordRS(f.tense1, data = tenseness, control = ctrl.multordRS(XforRS = FALSE), 
  model = "cumulative")
m.tense2.cumul

## Multivariate cumulative model, with response style as a random effect, with 
## explanatory variables for location AND response style
m.tense3.cumul <- multordRS(f.tense1, data = tenseness, model = "cumulative")
m.tense3.cumul

plot(m.tense3.cumul)

################################################################
## 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")

MultOrdRS documentation built on March 30, 2021, 1:07 a.m.