| clm_stan | R Documentation |
Fit a Cumulative Link Model using CmdStanR
clm_stan(
formula,
data,
link = "logit",
base = "logit",
threshold = "flexible",
link_param = NULL,
prior = NULL,
chains = 4,
iter = 2000,
warmup = NULL,
...
)
formula |
A formula specifying the model (response ~ predictors) |
data |
A data frame containing the variables in the formula |
link |
Link function. One of "logit" (default), "probit", "cloglog", "loglog", "cauchit", "tlink", "gev", "aep", "sp", "aranda_ordaz", "log_gamma" |
base |
Base distribution for SP link. One of "logit" (default), "probit", "cloglog", "loglog", "cauchit", "tlink". Ignored for other link functions. |
threshold |
Threshold structure. One of "flexible" (default), "equidistant", "symmetric" |
link_param |
A list of link parameters. For flexible links, values can be:
|
prior |
Prior specification. Can be either:
|
chains |
Number of MCMC chains (default: 4) |
iter |
Total iterations per chain (default: 2000) |
warmup |
Warmup iterations per chain. If NULL (default), uses floor(iter/2) |
... |
Additional arguments passed to cmdstanr::sample() |
An object of class "clmstan"
## Not run:
# Fit a proportional odds model
library(ordinal)
data(wine)
fit <- clm_stan(rating ~ temp + contact, data = wine, link = "logit")
print(fit)
# Fit with t-link (fixed df)
fit_t <- clm_stan(rating ~ temp, data = wine, link = "tlink",
link_param = list(df = 8))
# Fit with GEV link (estimate xi)
fit_gev <- clm_stan(rating ~ temp, data = wine, link = "gev",
link_param = list(xi = "estimate"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.