This runs MASS::polr()
after standardising all continuous predictors, while leaving
factors intact. Note that the Hessian (the observed information matrix)
is always returned, so that the Hess
argument cannot be used.
polr_std(formula, data = NULL, weights = NULL, ...)
a formula expression as for regression models, of the form
response ~ predictors
. The response should be a factor
(preferably an ordered factor), which will be interpreted as an
ordinal response, with levels ordered as in the factor.
The model must have an intercept: attempts to remove one will
lead to a warning and be ignored. An offset may be used. See the
documentation of formula
for other details.
an optional data frame, list or environment in which to interpret
the variables occurring in formula
.
optional case weights in fitting. Default to 1.
Arguments passed on to MASS::polr
start
initial values for the parameters. This is in the format
c(coefficients, zeta)
: see the Values section.
na.action
a function to filter missing data.
contrasts
a list of contrasts to be used for some or all of the factors appearing as variables in the model formula.
model
logical for whether the model matrix should be returned.
method
logistic or probit or (complementary) log-log or cauchit (corresponding to a Cauchy latent variable).
In the model call, the weights variable will always be called .weights
. This might
pose a problem when you update the model later on, for the moment the only workaround
is to rename the weights variable accordingly (or to fix it and contribute a PR on
Github).
See (Fox, 2015) for an argument why dummy variables should never be standardised.
polr_std(poverty ~ religion + age + gender, WVS)
#> Call:
#> MASS::polr(formula = poverty ~ religion + age + gender, data = data,
#> Hess = TRUE)
#>
#> Coefficients:
#> religionyes age gendermale
#> -0.0557976 0.2255645 0.1507886
#>
#> Intercepts:
#> Too Little|About Right About Right|Too Much
#> 0.03750694 1.77373803
#>
#> Residual Deviance: 10655.85
#> AIC: 10665.85