This repository accompanies the Bayesian Digit Analysis poster, presented in the O’Bayes 2019 conference in the University of Warwick (UK). The purpose of this repository is to share the data and the code that were used, facilitating the replicability of obtained results. Some supplementary graphs and tables are also provided.
In order to run the R scripts provided in this repository, the following R packages are required:
library("Hmisc")
library("tidyverse") It is still possible to reproduce all the results in the poster without
installing any package since Hmisc is only used to export R tables in
TeX format and tidyverse is only used to produce plots, which are
supplementary material.
The raw data can be found in the raw-data.xls file, stored in the
data-raw folder. The reorganized version of the dataset that is
imported by the R scripts is the data.txt file, stored in the data
folder.
We provide a self-contained Rstudio workflow that facilitates the
replicability of all the results in the poster. Open
bda-poster-warwick.Rproj first in order to direct R to the correct
working directory. After that, all the R scripts stored in the R
folder should run smoothly.
-
read-data.Ris an auxiliary script that is called within other scripts to import the data. -
auxiliary-functions.Rcontains several functions that we developed specifically for Bayesian digit analysis. This script is called within other scripts when necessary. -
The tables in the poster can be reproduced with
poster-tables-mu-dir.Randposter-tables-bin-beta.R.
-
Plots comparing observed versus expected digit frequencies can be found in the
plotsfolder. The code that generates the plots can be found inplots.R. -
The
tables-auxfolder contains the auxiliary tablesbin-beta-aux-austria.tex,bin-beta-aux-belgium.tex,bin-beta-aux-ireland.tex,bin-beta-aux-luxembourg.tex,bin-beta-aux-portugal.tex,mu-dir-aux-bl1.texandmu-dir-aux-bl2.texwhich are generated byaux-tables-bin.beta.Randaux-tables-mu-dir.R. Inaux-tables.texwe put together all these tables and perform some aesthetic changes obtainingaux-tables.pdf, a user-friendly compilation of all the tables in the poster.
- R - Free programming language and software environment for statistical computing and graphics.
- R Studio - Free and open-source IDE for R.
- TeX Live - Free distribution of the TeX typesetting system.
- Texmaker - Cross-platform and open-source LaTeX editor.
- CEMAPRE - Center for Applied Mathematics and Economics
- FCT - Foundation for Science and Technology (Portugal). Research grant reference: SFRH/BD/129918/2017 (funded by the European Social Fund and by national funds from the MCTES)
-
Author: Pedro Fonseca (ISEG) - pedro.teles.fonseca@outlook.com
-
Advisor: Prof. Rui Paulo (ISEG and CEMAPRE) - rui@iseg.ulisboa.pt

