RegressionAndOtherStories.jl v0.1.0
Project Status | Build Status |
---|---|
Purpose (once completed, maybe late 2022)
RegressionAndOtherStories.jl contains supporting (Julia) functions and the data files used in "Regression and Other Stories" by Andrew Gelham, Jennifer Hill and Aki Vehtari.
Contents
The supporting functions are intended to be used in (currently) 2 Julia projects (also under development), ROSStanPluto.jl and ROSTuringPluto.jl. See the lists of exported and not exported funtiens at the end of this file.
All data files are in .csv
format and located in the data
directory.
If RegressionAndOtherStories.jl is loaded, the files can be read in as a DataFrame using:
hibbs = CSV.read(ros_datadir("ElectionsEconomy", "hibbs.csv"), DataFrame)
For that purpose ros_datadir()
is exported.
If needed, Stata files (.dat
) have been converted to .csv
files using the scripts in the scripts
directory, e.g. see scripts\hdi.jl
. To access the Stata files in the R package ROS-Examples
RegressionAndOtherStories.jl expects the environment variable JULIA_ROS_HOME
to be defined, e.g.:
ENV["JULIA_ROS_HOME"] = expanduser("~/Projects/R/ROS-Examples")
R itself does not necessarily need to be installed for this to work. The ROS-Examples package can be found here.
If so desired, direct use of the Stata files is also possible as the Stata to .csv file conversion scripts mentioned above show.
Approach
The approach taken in RegressionAndOtherStories.jl and associated projects is different from StatisticalRethinking.jl.
In StatisticalRethinking.jl I attempted to create an intermediate layer to convert Stan and Turing mcmc results to a set of common functions. I am no longer happy with the complexity that introduced. In RegressionAndOtherStories.jl most functions work on DataFrames. It's up to the notebooks to create appropriate DataFrames in those cases.
If this approach turns out to be an improvement, I will consider updating the corresponding StatisticalRethinkingJulia projects as well.
Issues, comments and questions
Please file issues, comments and questions here.
Pull requests are also welcome.
Versions
Version 0.2.0
- Support for the 5 examples from chapter 1 done.
- Added plot_chains() and model_summary() functions.
- Added Makie and AlgebraOfGraphics as dependencies.
Note: Source files for Makie/AoG are all in src/Makie/ to simplify moving those to a separate repo (not my intention right now, but still).
- In sync with both ROS[Turing|Stan]Pluto projects tagged 2.3 and up.
Version 0.1.0
- Initial commit (to registrate the package for usage in projects).
References
Of course this package is focused on:
which in a sense is a major update to item 3. below.
There is no shortage of other good books on Bayesian statistics. A few of my favorites are:
-
Gelman, Hill: Data Analysis Using Regression and Multilevel/Hierarchical Models
-
Betancourt: A Conceptual Introduction to Hamiltonian Monte Carlo
-
Pearl, Glymour, Jewell: Causal Inference in Statistics: A Primer
Functions defined in this package:
Currently exported functions (see online help)
- ros_path
- ros_data
- ros_datadir
- plot_chains
- model_summary
Currently not exported functions (see online help)
- None yet