https://github.com/centre-for-humanities-computing/bog-nu-analysis

Bayesian regression analysis of Bog.nu ratings.

https://github.com/centre-for-humanities-computing/bog-nu-analysis

Science Score: 13.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
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (5.4%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Bayesian regression analysis of Bog.nu ratings.

Basic Info
  • Host: GitHub
  • Owner: centre-for-humanities-computing
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 9.77 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 2 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.md

bog-nu-analysis

Bayesian Beta Binomial regression analysis of Bog.nu ratings.

Model description

We model book ratings using a beta-binomial distribution, that I reparameterized for easier interpretation.

Data

  • a indicates whether the author is male (0 or 1).
  • r indicates whether the reviewer is male (0 or 1).
  • y is the rating - 1 (integers between 0-5).

Parameterization

Instead of using α and β, we use the mean of the distribution and a shape parameter: - $\mu = n \cdot \frac{\alpha}{\alpha + \beta}$ - $p = log(\frac{\alpha+\beta}{2})$ - $n=5$

When $p = 0$, that means that the distribution is flat (uniform),
when $p > 0$, the distribution is concave,
when $p < 0$, the distribution is convex.

Parameters

We fit an intercept and then effects for: - The author being male; - The reviewer being male; - Their interaction; in both parameters.

The priors are set as such: - Intercepts: - $\mu0 \sim N(2.5, 0.2)$ - $p0 \sim N(0.0, 0.2)$ - All Effects: - $\lambda \sim N(0.0, 0.2)$

Outcome

The likelihood is then a Beta Binomial:

  • $\mu = \mu0 + \lambda{\mu, a} \cdot a + \lambda{\mu, r} \cdot r + \lambda{\mu, a:r} \cdot (a \cdot r)$
  • $p = p0 + \lambda{p, a} \cdot a + \lambda{p, r} \cdot r + \lambda{p, a:r} \cdot (a \cdot r)$
  • $\alpha = \frac{\mu \cdot e^{2 \cdot p}}{n}$
  • $\beta = e^{2 \cdot p} - \alpha$
  • $y \sim BetaBinomial(n, \alpha, \beta)$

Inference

Install requirements:

bash pip install -r requirements.txt

Then run the scipt, which will save a parameter summary in the results/ directory and figures in the figures/ directory. The data has to be in tab separated format under dat/data_w_themes.csv.

bash python3 beta_binomial_model.py

Owner

  • Name: Center for Humanities Computing Aarhus
  • Login: centre-for-humanities-computing
  • Kind: organization
  • Email: chcaa@cas.au.dk
  • Location: Aarhus, Denmark

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels