Package: beezdiscounting 0.4.0

beezdiscounting: Behavioral Economic Easy Discounting

Facilitates some of the analyses performed in studies of behavioral economic discounting. The package supports scoring of the 27-Item Monetary Choice Questionnaire (see Kaplan et al., 2016; <doi:10.1007/s40614-016-0070-9>), calculating k values (Mazur's simple hyperbolic and exponential) using nonlinear regression, calculating various Area Under the Curve (AUC) measures, plotting regression curves for both fit-to-group and two-stage approaches, checking for unsystematic discounting (Johnson & Bickel, 2008; <doi:10.1037/1064-1297.16.3.264>) and scoring of the minute discounting task (see Koffarnus & Bickel, 2014; <doi:10.1037/a0035973>) using the Qualtrics 5-trial discounting template (see the Qualtrics Minute Discounting User Guide; <doi:10.13140/RG.2.2.26495.79527>), which is also available as a .qsf file in this package. The package also fits mixed-effects (hierarchical) discounting models with a scale-location-truncated beta likelihood that admits indifference points at exactly 0 and 1 (Kim, Kaplan, Koffarnus, and Franck, 2025; <arxiv:2509.13167>).

Authors:Brent A. Kaplan [aut, cre, cph]

beezdiscounting_0.4.0.tar.gz
beezdiscounting_0.4.0.zip(r-4.7)beezdiscounting_0.4.0.zip(r-4.6)beezdiscounting_0.4.0.zip(r-4.5)
beezdiscounting_0.4.0.tgz(r-4.6-x86_64)beezdiscounting_0.4.0.tgz(r-4.6-arm64)beezdiscounting_0.4.0.tgz(r-4.5-x86_64)beezdiscounting_0.4.0.tgz(r-4.5-arm64)
beezdiscounting_0.4.0.tar.gz(r-4.7-arm64)beezdiscounting_0.4.0.tar.gz(r-4.7-x86_64)beezdiscounting_0.4.0.tar.gz(r-4.6-arm64)beezdiscounting_0.4.0.tar.gz(r-4.6-x86_64)
beezdiscounting_0.4.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
beezdiscounting/json (API)

# Install 'beezdiscounting' in R:
install.packages('beezdiscounting', repos = c('https://brentkaplan.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/brentkaplan/beezdiscounting/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • dd_ip - Delay Discounting Data
  • five.fivetrial_dd - Example Qualtrics output from the 5.5 trial delay discounting template.
  • five.fivetrial_pd - Example Qualtrics output from the 5.5 trial probability discounting template.
  • mcq27 - Example 27-item MCQ data

On CRAN:

Conda:

5-trial-discountingdelay-discountingmonetary-choice-questionnairecpp

5.60 score 2 stars 4 scripts 252 downloads 42 exports 68 dependencies

Last updated from:2d282b52a1 (on develop). Checks:13 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK292
linux-devel-x86_64OK269
source / vignettesOK419
linux-release-arm64OK306
linux-release-x86_64OK286
macos-release-arm64OK257
macos-release-x86_64OK324
macos-oldrel-arm64OK137
macos-oldrel-x86_64OK391
windows-develOK306
windows-releaseOK283
windows-oldrelOK263
wasm-releaseOK202

Exports:%>%ans_ddans_pdaugmentcalc_aucscalc_conf_intcalc_ddcalc_pdcalc_r2check_unsystematicdefault_dd_choice_priorsdefault_dd_priorsfit_ddfit_dd_brmsfit_dd_choicefit_dd_choice_brmsfit_dd_tmbfixefgenerate_data_mcqget_dd_comparisonsget_dd_param_emmsget_lookup_tableglancelong_to_wide_mcqlong_to_wide_mcq_excelmcq27_to_choiceplot_ddplot_qqprop_ssranefresults_ddscore_ddscore_mcq27score_pdsimulate_dd_choicesimulate_dd_ipsummarize_mcqtidytiming_ddtiming_pdwide_to_long_mcqwide_to_long_mcq_excel

Dependencies:backportsbayestestRbeezdemandbootbroomclicpp11datawizarddigestdplyremmeansestimabilityfarvergenericsggplot2glueGPArotationgtablegtoolsinsightisobandlabelinglatticelhslifecyclelme4magrittrMASSMatrixminpack.lmminqamnormtmvtnormnlmenloptrnls.multstartnls2nlsrnlstoolsnumDerivoptimxperformancepillarpkgconfigpracmaprotopsychpurrrR6rbibutilsRColorBrewerRcppRcppEigenRdpackreformulasrlangS7scalesstringistringrtibbletidyrtidyselectTMButf8vctrsviridisLitewithr

Bayesian discounting models with brms
Indifference points | Families and boundaries | Priors | Trial-level choice | Reading Bayesian output | Random effects

Last update: 2026-06-23
Started: 2026-06-11

Mixed-effects discounting with TMB
Why TMB | Some data | Fitting a model | Inspecting the fit | Subject-level rates | Predictions | Diagnostics | Choosing an equation | Beyond one group and one random effect | Practical notes | Relationship to Young (2017) | See also | References

Last update: 2026-06-19
Started: 2026-06-17

Comparing discounting rates between groups
Simulate a two-group study | Fit with a factor design on log k | Estimated marginal means of k | Contrasts | Visualizing the contrasts | Trial-level choice models | The Bayesian analogs | Which backend when

Last update: 2026-06-18
Started: 2026-06-11

Discounting from trial-level choices
Data format | Structural model | Descriptive model (Young, 2018) | S3 methods | From the 27-item MCQ to choices | Indifference points and choices agree | Where to go next | References

Last update: 2026-06-18
Started: 2026-06-18

Getting started: indifference points, k, and AUC
Indifference points | Screening for unsystematic data | Fitting a discounting model | Area under the curve | Working at scale | Where to go next | References

Last update: 2026-06-17
Started: 2026-06-17

Scoring the 27-Item Monetary Choice Questionnaire
The questionnaire | Data format | Scoring | A magnitude effect | Summarizing a sample | A model-free look at the choice gradient | Converting between layouts | Handling missing responses | From choices to trial-level data | References

Last update: 2026-06-17
Started: 2026-06-17

Scoring the 5.5-trial discounting task
A one-minute discounting task | The raw data | Scoring delay discounting | Response times | Scoring probability discounting | References

Last update: 2026-06-17
Started: 2026-06-17

Modeling delay-discounting indifference points with bounded error distributions
Why indifference points need a bounded error distribution | What the SLT-beta density is | The boundary problem, in the example data | Fitting the mixed-effects model | Choosing a family | How much to trust it | References

Last update: 2026-06-07
Started: 2026-06-07

Readme and manuals

Help Manual

Help pageTopics
Converts answers from 5.5 trial delay discounting from Qualtrics templateans_dd
Converts answers from 5.5 trial probability discounting from Qualtrics templateans_pd
Augment a beezdiscounting_choice modelaugment.beezdiscounting_choice
Augment a beezdiscounting_tmb modelaugment.beezdiscounting_tmb
Calculate Area-Under-the-Curve (AUC) Metrics for Delay Discounting Datacalc_aucs
Calculate Confidence Intervals for a Parametercalc_conf_int
Calculate scores, answers, and timing for 5.5 trial delay discounting from Qualtrics templatecalc_dd
Calculate scores, answers, and timing for 5.5 trial probability discounting from Qualtrics templatecalc_pd
Calculate R-Squared for a Modelcalc_r2
Check for Unsystematic Data Violationscheck_unsystematic
Extract coefficients from a structural choice modelcoef.beezdiscounting_choice
Extract coefficients from a TMB discounting modelcoef.beezdiscounting_tmb
Credible intervals for a beezdiscounting_brms modelconfint.beezdiscounting_brms
Confidence intervals for a structural choice discounting modelconfint.beezdiscounting_choice
Credible intervals for a beezdiscounting_choice_brms modelconfint.beezdiscounting_choice_brms
Confidence intervals for a TMB discounting modelconfint.beezdiscounting_tmb
Delay Discounting Datadd_ip
Default priors for the Bayesian (brms) choice modeldefault_dd_choice_priors
Default priors for Bayesian (brms) delay-discounting modelsdefault_dd_priors
Fit Delay-Discounting Modelfit_dd
Fit a Bayesian Mixed-Effects Discounting Model via brmsfit_dd_brms
Fit a trial-level SS-vs-LL choice model (binomial GLMM) via TMBfit_dd_choice
Fit a Bayesian Structural Choice Discounting Model via brmsfit_dd_choice_brms
Fit an indifference-point mixed-effects discounting model via TMBfit_dd_tmb
Fitted values for a beezdiscounting_choice fitfitted.beezdiscounting_choice
Fitted values for a beezdiscounting_tmb fitfitted.beezdiscounting_tmb
Example Qualtrics output from the 5.5 trial delay discounting template.five.fivetrial_dd
Example Qualtrics output from the 5.5 trial probability discounting template.five.fivetrial_pd
Extract fixed effects from a structural choice modelfixef.beezdiscounting_choice
Extract fixed effects from a TMB discounting modelfixef.beezdiscounting_tmb
Generate fake MCQ datagenerate_data_mcq
Factor-level comparisons of the discount rate 'k'get_dd_comparisons
Estimated marginal means of the discount rate 'k'get_dd_param_emms
Get internal lookup table for the 27-item MCQget_lookup_table
Glance at a beezdiscounting_brms modelglance.beezdiscounting_brms
Glance at a beezdiscounting_choice modelglance.beezdiscounting_choice
Glance at a beezdiscounting_choice_brms modelglance.beezdiscounting_choice_brms
Glance at a beezdiscounting_tmb modelglance.beezdiscounting_tmb
Reshape MCQ data long to widelong_to_wide_mcq
Reshape MCQ data from long to wide (as used in the 21- and 27-Item Monetary Choice Questionnaire Automated Scorer)long_to_wide_mcq_excel
Example 27-item MCQ datamcq27
Convert 27-item MCQ responses to a trial-level choice framemcq27_to_choice
Plot Delay-Discounting Modelplot_dd
Random-effect normal QQ plots for discounting modelsplot_qq.beezdiscounting plot_qq.beezdiscounting_choice plot_qq.beezdiscounting_tmb
Plot a Bayesian (brms) indifference-point discounting modelplot.beezdiscounting_brms
Plot a choice-based discounting modelplot.beezdiscounting_choice
Plot a Bayesian (brms) choice-based discounting modelplot.beezdiscounting_choice_brms
Plot group differences in discount rateplot.beezdiscounting_comparison
Plot a mixed-effects discounting modelplot.beezdiscounting_tmb
Plot Proportion of SIR/SS Choices by k Valueplot.prop_ss_output
Plot MCQ-27 Scoresplot.score_mcq27_output
Predict from a beezdiscounting_brms modelpredict.beezdiscounting_brms
Predict from a structural choice discounting modelpredict.beezdiscounting_choice
Predict P(LL) from a beezdiscounting_choice_brms modelpredict.beezdiscounting_choice_brms
Predict from a TMB mixed-effects discounting modelpredict.beezdiscounting_tmb
Print a structural choice discounting fitprint.beezdiscounting_choice
Print a TMB mixed-effects discounting fitprint.beezdiscounting_tmb
Print a structural choice discounting model summaryprint.summary.beezdiscounting_choice
Print a TMB discounting model summaryprint.summary.beezdiscounting_tmb
Calculate proportion of SIR/SS responses at each k valueprop_ss
Extract subject-level random effects from a choice modelranef.beezdiscounting_choice
Extract subject-level random effects from a TMB discounting modelranef.beezdiscounting_tmb
Residuals for a beezdiscounting_choice fitresiduals.beezdiscounting_choice
Residuals for a beezdiscounting_tmb fitresiduals.beezdiscounting_tmb
Extract Results from Delay-Discounting Modelresults_dd
Score 5.5 trial delay discounting from Qualtrics templatescore_dd
Score 27-item MCQscore_mcq27
Score 5.5 trial probability discounting from Qualtrics templatescore_pd
Simulate trial-level SS-vs-LL choice datasimulate_dd_choice
Simulate IP-family mixed-effects discounting datasimulate_dd_ip
Provide a summary of the results from the MCQ output table.summarize_mcq
Summarize a beezdiscounting_brms modelsummary.beezdiscounting_brms
Summarize a structural choice discounting fitsummary.beezdiscounting_choice
Summarize a beezdiscounting_choice_brms modelsummary.beezdiscounting_choice_brms
Summarize a TMB mixed-effects discounting fitsummary.beezdiscounting_tmb
Tidy a beezdiscounting_brms modeltidy.beezdiscounting_brms
Tidy a beezdiscounting_choice model into a coefficient tibbletidy.beezdiscounting_choice
Tidy a beezdiscounting_choice_brms modeltidy.beezdiscounting_choice_brms
Tidy a discounting comparison into a flat contrasts frametidy.beezdiscounting_comparison
Tidy a beezdiscounting_tmb model into a coefficient tibbletidy.beezdiscounting_tmb
Extract timing metrics from 5.5 trial delay discounting from Qualtrics templatetiming_dd
Extract timing metrics from 5.5 trial probability discounting from Qualtrics templatetiming_pd
Random-effect (co)variances for a beezdiscounting_choice fitVarCorr.beezdiscounting_choice
Random-effect covariance for a TMB discounting modelVarCorr.beezdiscounting_tmb
Reshape MCQ data wide to longwide_to_long_mcq
Reshape MCQ data from wide (as used in the 21- and 27-Item Monetary Choice Questionnaire Automated Scorer) to longwide_to_long_mcq_excel