View source: R/ordinal_reg-clm.R
| clm_wrapper | R Documentation |
ordinal::clm()Fit clm(), translating parallel_reg into the nominal formula. This is
done here rather than in parsnip::translate() because the formula can only
be split once data is known, and because the standard translation
(make_form_call()) overwrites any location formula that translate() sets.
clm_wrapper(
formula,
data,
weights = NULL,
parallel_reg = NULL,
link = NULL,
threshold = NULL,
...,
call = rlang::caller_env()
)
formula |
The formula to pass. |
data |
The data frame to pass. |
weights |
An optional vector of case weights to pass. |
parallel_reg |
Logical; whether predictor effects are shared across
thresholds. When |
... |
Additional arguments to pass. |
call |
The execution environment of a currently running function. |
An object of class clm as returned by ordinal::clm().
house_data <-
MASS::housing[rep(seq(nrow(MASS::housing)), MASS::housing$Freq), -5]
# arguments are translated
( fit_orig <- ordinal::clm(
Sat ~ Type + Cont, data = house_data,
link = "logit", threshold = "symmetric2"
) )
( fit_wrap <- clm_wrapper(
Sat ~ Type + Cont, data = house_data,
link = "logistic", threshold = "symmetric_zero"
) )
# relax the parallel regression assumption
( fit_orig <- ordinal::clm(
Sat ~ 1, data = house_data,
nominal = ~ Infl + Cont
) )
( fit_wrap <- clm_wrapper(
Sat ~ Infl + Cont, data = house_data,
parallel_reg = FALSE
) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.