View source: R/helpers-analysis.R
| sdt_thresholds | R Documentation |
Extracts the K-1 latent decision thresholds of a rating signal
detection model fit with bmm(). Thresholds are not posterior parameters:
they are reconstructed per draw from the criterion and the parameterization
parameters (spacing and/or delta*), whose mapping to ordered thresholds
depends on the model's threshold_type. This function returns those draws on
the latent decision-variable scale together with a posterior summary, so
threshold estimates are accessible without knowing the parameterization.
Which threshold separates "noise" from "signal" responses depends on whether
the number of categories is even or odd; see the section "Where criterion
sits" in sdt_rating().
sdt_thresholds(fit, conditions = NULL, probs = c(0.025, 0.975), ...)
fit |
A |
conditions |
Optional data frame of predictor values at which to
evaluate the model. Column names must match predictor variables used in
the formula. If |
probs |
Numeric vector of length 2. Lower and upper quantiles for the
credible interval (default |
... |
Additional arguments passed to |
A data frame of class "bmm_sdt_thresholds" with columns marker
(threshold label t1, t2, ...), position (latent location), .draw,
and any condition columns. The object carries a summary attribute
(marker, position posterior mean, lower, upper, plus condition
columns). The position/lower/upper naming matches the lines
attribute of latent_sdt(), which visualises the same quantities. The
object also carries probs, model_class, dist and conditions.
latent_sdt(), roc_sdt()
## Not run:
dat <- expand.grid(id = 1:20, stimulus = c(0L, 1L))
dat <- cbind(dat, rsdt_rating(nrow(dat), 200, dat$stimulus, d = 1.5,
thresholds = c(0.25, 0.75, 1.25), sdratio = 1.3))
fit <- bmm(
formula = bmf(d ~ 1, criterion ~ 1, spacing ~ 1, sdratio ~ 1),
data = dat,
model = sdt_rating(response = c("r1", "r2", "r3", "r4"),
stimulus = "stimulus"),
cores = 4,
backend = "cmdstanr"
)
sdt_thresholds(fit)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.