hbamr
Hierarchical Bayesian Aldrich-McKelvey Scaling in R via Stan
Science Score: 49.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
1 of 4 committers (25.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.3%) to scientific vocabulary
Keywords
Repository
Hierarchical Bayesian Aldrich-McKelvey Scaling in R via Stan
Basic Info
- Host: GitHub
- Owner: jbolstad
- License: gpl-3.0
- Language: R
- Default Branch: main
- Homepage: https://jbolstad.github.io/hbamr/
- Size: 8.68 MB
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
hbamr 
Hierarchical Bayesian Aldrich-McKelvey Scaling
This is an R package for performing hierarchical Bayesian Aldrich-McKelvey (HBAM) scaling using Hamiltonian Monte Carlo simulations 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 (Aldrich & McKelvey 1977). The hierarchical versions of the 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 (Bølstad 2024). The package contains functions for preparing data, fitting models, extracting estimates, plotting key results, and comparing models using cross-validation.
Important Updates
Version 2.1.0:
- All models now simulate errors in respondents' self-placements to yield realistic levels of uncertainty in estimated respondent positions while offering faster sampling.
Version 2.0.1:
- New MULTI-type models explicitly model group-differences.
- Models of FBAM-type now allow users to specify key priors.
- Most models have been revised to offer faster and better sampling.
See the changelog for a more comprehensive discussion of the updates.
Installation
The package is available from CRAN and can be installed using the standard method:
r
install.packages("hbamr")
This is the easiest and fastest way to install the package, as the binaries on CRAN include pre-compiled models that are ready for use.
Vignette
A vignette showing how to use all key functions in the package is available here. It can also be viewed locally, after installing the package:
r
vignette("hbamr")
Usage
Load the package:
r
library("hbamr")
Load and re-code example data:
r
data(LC1980)
LC1980[LC1980 == 0 | LC1980 == 8 | LC1980 == 9] <- NA
self <- LC1980[, 1]
stimuli <- LC1980[, -1]
Fit the standard HBAM model:
r
fit_hbam <- hbam(self, stimuli)
Fit the HBAM_MINI model:
r
fit_hbam_mini <- hbam(self, stimuli, model = "HBAM_MINI")
Plot the estimated stimuli positions:
r
plot_stimuli(fit_hbam)
Plot the distribution of estimated respondent positions:
r
plot_respondents(fit_hbam)
Plot the estimated scale-stretching parameters over respondents' self-placements:
r
plot_over_self(list(fit_hbam, fit_hbam_mini), "abs_beta")
References
- Aldrich, John H, and Richard D McKelvey. 1977. "A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections." American Political Science Review 71(1): 111-130.
- Bølstad, Jørgen. 2020. "Capturing Rationalization Bias and Differential Item Functioning: A Unified Bayesian Scaling Approach." Political Analysis 28(3): 340-355.
- Bølstad, Jørgen. 2024. "Hierarchical Bayesian Aldrich-McKelvey Scaling." Political Analysis 32(1): 50-64.
- Hare, Christopher et al. 2015. "Using Bayesian Aldrich-McKelvey Scaling to Study Citizens' Ideological Preferences and Perceptions." American Journal of Political Science 59(3): 759-774.
Owner
- Name: Jørgen Bølstad
- Login: jbolstad
- Kind: user
- Location: Oslo
- Company: University of Oslo
- Website: www.estimite.com
- Twitter: boelstad
- Repositories: 1
- Profile: https://github.com/jbolstad
Associate Professor of Political Science. I do causal inference and develop Bayesian models.
GitHub Events
Total
- Push event: 18
Last Year
- Push event: 18
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| jbolstad | j****d@g****m | 276 |
| Jørgen Bølstad | b****d@J****n | 7 |
| Andrew Johnson | a****n@a****m | 1 |
| Jørgen Bølstad | b****d@e****o | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 0
- Total pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: about 9 hours
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: about 9 hours
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 410 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 18
- Total maintainers: 1
cran.r-project.org: hbamr
Hierarchical Bayesian Aldrich-McKelvey Scaling via 'Stan'
- Homepage: https://jbolstad.github.io/hbamr/
- Documentation: http://cran.r-project.org/web/packages/hbamr/hbamr.pdf
- License: GPL (≥ 3)
-
Latest release: 2.4.4
published 6 months ago