## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>",
                      fig.width = 7, fig.height = 5)
library(bayesqm)

## ----eval = FALSE-------------------------------------------------------------
# qdata <- read_qsort("mystudy.dat")        # PQMethod file, for example
# qdata <- qsort_data(Y, distribution = c(2, 3, 4, 5, 4, 3, 2))

## ----fig.height = 6-----------------------------------------------------------
data(obesity_sorts)
plot(obesity_sorts, participants = 1:6)

## -----------------------------------------------------------------------------
fit <- demo_fit(seed = 1)
fit

## -----------------------------------------------------------------------------
head(compute_loadings(fit))

## -----------------------------------------------------------------------------
compute_flags(fit)

## -----------------------------------------------------------------------------
head(compute_factor_array(fit))

## -----------------------------------------------------------------------------
plot_factor_array(fit)

## -----------------------------------------------------------------------------
qdc <- compute_qdc(fit)
table(qdc$verdict)

## -----------------------------------------------------------------------------
plot_contrasts(fit)

## -----------------------------------------------------------------------------
claims(fit, q = 0.05)

## -----------------------------------------------------------------------------
factor_characteristics(fit)

## -----------------------------------------------------------------------------
check_fit(fit, draws = 30)

## -----------------------------------------------------------------------------
check_persons(fit, draws = 15, mixes = 30)

## ----eval = FALSE-------------------------------------------------------------
# ladder <- fit_ladder(qdata)
# select_k(ladder)
# plot_choice_k(select_k(ladder))

