| rcogmod_choco | R Documentation |
Simulates data from the Choice-Confidence (CHOCO) model. This model is useful for subjective ratings (e.g., Likert-type scales) where responses represent a choice between two underlying categories (e.g., "disagree" vs. "agree") along with a degree of confidence or intensity.
The CHOCO model divides the response scale at a middle-value. Responses above and below the
middle are modeled by two rescaled (and mirrored for the left side) Beta-Gate distributions.
In Beta-Gate distributions, extreme values (0 or 1) are generated by the "lumping" of values
that crossed a threshold (or "gate"). The location of these gates from the center of the
distribution is controlled by the pex and bex parameters, influecing the ease of crossing
the gate (and thus the probability of extreme values).
rcogmod_choco(
n,
p = 0.5,
confright = 0.5,
precright = 4,
confleft = 0.5,
precleft = 4,
pex = 0.1,
bex = 0.5,
pmid = 0,
mid = 0.5
)
dcogmod_choco(
x,
p = 0.5,
confright = 0.5,
precright = 4,
confleft = 0.5,
precleft = 4,
pex = 0.1,
bex = 0.5,
pmid = 0,
mid = 0.5,
log = FALSE
)
cogmod_choco_lpdf_expose()
cogmod_choco_stanvars()
cogmod_choco(
link_mu = "logit",
link_confright = "logit",
link_precright = "softplus",
link_confleft = "logit",
link_precleft = "softplus",
link_pex = "logit",
link_bex = "logit",
link_pmid = "logit"
)
log_lik_cogmod_choco(i, prep)
posterior_predict_cogmod_choco(i, prep, ...)
posterior_epred_cogmod_choco(prep)
n |
Number of simulated trials. |
p |
Proportion parameter determining the balance between the left and right sides
after excluding the probability mass at the middle ( |
confright, confleft |
Mean parameter ( |
precright, precleft |
Precision parameter ( |
pex |
Controls the location of the lower and upper boundary gates ( |
bex |
Balances the extreme probability mass |
pmid |
Probability mass exactly at the |
mid |
The point dividing the scale ( |
x |
Vector of quantiles (values at which to evaluate the density). Must be between 0 and 1, inclusive. |
log |
Logical; if TRUE, returns the log-density. |
link_mu, link_confright, link_precright, link_confleft, link_precleft, link_pex, link_bex, link_pmid |
Link functions for the parameters. |
i, prep |
For brms' functions to run: index of the observation and a |
... |
Additional arguments. |
Psychological Interpretation:
p: Represents the overall tendency to choose the "right" category (e.g., "agree") over the "left"
category (e.g., "disagree"), given that a choice is made (i.e., not responding exactly at mid).
confright and confleft: Average confidence level when choosing the "right" or "left" category.
Higher values (closer to 1) indicate stronger confidence or agreement towards the extreme end of the
scale.
precright and precleft: Certainty or consistency of the confidence ratings for the right and left
choices, respectively. Higher values indicate less variability in confidence ratings around their
respective means (confright, confleft).
pex: Represents the overall tendency towards extreme responding (choosing 0 or 1).
This could reflect individual response styles (e.g., acquiescence, yea-saying/nay-saying)
or properties of the item itself (e.g., polarizing questions).
bex: Indicates the direction of the extreme response bias. bex > 0.5 suggests a bias
for producing ones more easily, while bex < 0.5 suggests a bias towards zero.
rcogmod_choco() returns a numeric vector of n simulated ratings
on the unit interval [0, 1], including exact 0s and 1s from the
extreme-response gates and exact mid values. dcogmod_choco() returns
the density at each element of x - the log density if log = TRUE -
recycled to the length of the longest argument; at 0, 1 and mid it
is the probability mass rather than a density. cogmod_choco() returns a
brms::custom_family object, to put on a brms::bf() formula.
cogmod_choco_stanvars() returns a brms::stanvars object holding the
family's Stan functions block, to pass to brms::brm(), and
cogmod_choco_lpdf_expose() compiles that Stan code and returns it as an
R function, for checking the density outside of a model. The remaining
functions are brms post-processing methods, called by brms rather than
directly: log_lik_cogmod_choco() returns a numeric vector holding one
log-likelihood value per posterior draw for observation i,
posterior_predict_cogmod_choco() a draws x 1 matrix of ratings simulated
for observation i, and posterior_epred_cogmod_choco() a
draws x observations matrix of expected ratings.
Kubinec, R. (2023). Ordered beta regression: a parsimonious, well-fitting model for continuous data with lower and upper bounds. Political Analysis, 31(4), 519-536. (Describes the underlying ordered beta model)
rcogmod_betagate
# Simulate data with different parameterizations
# 10% at mid, 50/50 split otherwise, symmetric confidence/precision
x1 <- rcogmod_choco(
n = 5000, p = 0.5, confright = 0.5, precright = 4,
confleft = 0.5, precleft = 4, pex = 0.1, bex = 0.5, pmid = 0, mid = 0.5
)
hist(x1, breaks = 50, main = "CHOCO: Symmetric Confidence/Precision", xlab = "y")
# No mid mass, 70% probability on right, higher confidence left (closer to 0)
x2 <- rcogmod_choco(
n = 5000, p = 0.7, confright = 0.5, precright = 3,
confleft = 0.8, precleft = 5, pex = 0.15, bex = 0.7, pmid = 0, mid = 0.5
)
hist(x2, breaks = 50, main = "CHOCO: Asymmetric p, Higher Conf Left", xlab = "y")
# Lower confidence overall (closer to mid), high probability in the middle
x3 <- rcogmod_choco(
n = 5000, p = 0.5, confright = 0.2, precright = 3,
confleft = 0.2, precleft = 3, pex = 0, bex = 0.5, pmid = 0.05, mid = 0.5
)
hist(x3, breaks = 50, main = "CHOCO: Low confidence overall", xlab = "y")
cogmod_choco()
# Example usage in a brms formula:
brms::bf(y ~ x1 + (1 | group),
confright ~ x3,
confleft ~ x3,
precright ~ 1,
precleft ~ 1,
pex ~ age,
bex ~ 1,
pmid ~ 1,
family = cogmod_choco()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.