Learn R Programming

hbamr (version 2.4.4)

Hierarchical Bayesian Aldrich-McKelvey Scaling via 'Stan'

Description

Perform hierarchical Bayesian Aldrich-McKelvey scaling using Hamiltonian Monte Carlo via 'Stan'. Aldrich-McKelvey ('AM') scaling is a method for estimating the ideological positions of survey respondents and political actors on a common scale using positional survey data. The hierarchical versions of the Bayesian 'AM' model included in this package outperform other versions both in terms of yielding meaningful posterior distributions for respondent positions and in terms of recovering true respondent positions in simulations. The package contains functions for preparing data, fitting models, extracting estimates, plotting key results, and comparing models using cross-validation. The original version of the default model is described in Bølstad (2024) .

Copy Link

Version

Install

install.packages('hbamr')

Monthly Downloads

448

Version

2.4.4

License

GPL (>= 3)

Maintainer

Jørgen Bølstad

Last Published

August 18th, 2025

Functions in hbamr (2.4.4)

LC1980

1980 Liberal-Conservative Scales
hbamr-package

Hierarchical Bayesian Aldrich-McKelvey Scaling via Stan
fbam

Fit an FBAM model using optimization
get_plot_data

Extract data for plotting results from an HBAM model
plot_by_group

Plot posterior densities of parameter averages by group
hbam_cv

Perform K-fold cross-validation
plot_over_self

Plot individual parameter estimates over self-placements
get_est

Extract point estimates or other summaries of marginal posterior distributions
prep_data

Prepare data to fit an HBAM or FBAM model
plot_stimuli

Plot estimated stimulus positions
hbam

Fit an HBAM model
plot_respondents

Plot estimated respondent positions
prep_data_cv

Prepare data for a K-fold cross-validation of an HBAM model
LC2012

2012 Liberal-Conservative Scales