# Any applications of Julia in Official Statistics?

**URL:** <https://discourse.julialang.org/t/any-applications-of-julia-in-official-statistics/58123>\
**Category:** New to Julia\
**Tags:** statistics\
**Created:** [March 28, 2021, 5:02pm UTC](https://discourse.julialang.org/t/any-applications-of-julia-in-official-statistics/58123 "2021-03-28T17:02:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Post date:** [March 28, 2021, 5:02pm UTC](https://discourse.julialang.org/t/any-applications-of-julia-in-official-statistics/58123/1 "2021-03-28T17:02:03Z")

</div>

I tried to find something without success.  
There is a site with many applications in official statistics but mainly in `R`, `Python` and `Java`: [awesome-official-statistics-software](https://github.com/SNStatComp/awesome-official-statistics-software)

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [March 28, 2021, 5:49pm UTC](https://discourse.julialang.org/t/any-applications-of-julia-in-official-statistics/58123/2 "2021-03-28T17:49:23Z")

</div>

I don’t know too much about “creating and accessing official statistics” but it it’s just a matter of getting access to some data, then you can call all Python, R and Java libraries (or call Julia from those languages), and even NodeJS libraries, such as those under the “Access to official statistics (GSBPM 7.4)” heading.

See here (a lot of Julia stats packages are available):

> **[Overview of the Julia-Python-R Universe - Open Risk Manual](https://www.openriskmanual.org/wiki/Overview_of_the_Julia-Python-R_Universe)**
>
> Open Risk Manual Entry

some info might be outdated, e.g. regarding:

> **[JuliaCall: Seamless Integration Between R and 'Julia'](https://cran.r-project.org/web/packages/JuliaCall/index.html)**
>
> Provides an R interface to 'Julia', which is a high-level, high-performance dynamic programming language for numerical computing, see \<https://julialang.org/\> for more information. It provides a high-level interface as well as a low-level...

The New York Fed was one of the first Julia users, if that applies.

I don’t know what the major data format is, but if this one (not just JSON, that works fine in Julia), then the package is outdated and will not install in Julia 1.0+ so you may need to use PyCall or RCall and get data that way, while it should also be simple to update this package to work (e.g. add Projects.toml file):

```julia
(@v1.6) pkg> add https://github.com/klpn/JSONStat.jl

```

I confirmed pyjstat works in Python and then the same example in Julia:

```julia
py"""
using PyCall
...
print(dataset_from_df.write())
"""

```

you just have to get the dataset over to Julia (there’s probably a better way straight into a Julia JSON, that keeps order of the keys, DIct doesn’t, or DataFrame were such applies):

```julia
julia> julia_side = py"pyjstat.Dataset.read(df)"
Dict{Any, Any} with 8 entries:
  "source" => "Self-elaboration"
  "class" => "dataset"
  "id" => ["place of birth", "age group", "gender", "year", "province of residence", "concept"]
  "dimension" => Dict{Any, Any}("age group"=>Dict{Any, Any}("label"=>"age group", "category"=>Dict{Any, Any}("label"=>Dict{Any, Any}("0-4"=>"0-4", "75-79"=>"75-79", "…
  "value" => Union{Nothing, Float64}[2.69588e6, 1.09603e6, 357648.0, 338446.0, 903759.0, 2.77293e6, 1.14129e6, 348067.0, 328697.0, 954877.0 … 7.0, 0.0, 0.0, 3.0…
  "size" => [6, 22, 3, 2, 5, 1]
  "version" => "2.0"
  "updated" => "2021-03-28T18:30:26.556933"

```

Depending on what you mean by statistics and “official”, you can’t have a larger dataset to do statistics on than the entire Universe, i.e. “performs approximate Bayesian inference”:

> **[Berkeley Lab-Led Collaborations Honored for HPC Innovation Excellence](https://www.hpcwire.com/off-the-wire/berkeley-lab-led-collaborations-honored-hpc-innovation-excellence/)**
>
> Jan. 10, 2018 — Two Berkeley Lab-led projects—Celeste and Galactos—were honored with Hyperion Research’s 2017 HPC Innovation Excellence Award for “the outstanding application of HPC for business and scientific achievements.” According...

> [Celeste: A New Model for Cataloging the Universe](https://insidehpc.com/2017/06/hpc-innovation-excellence-awards-announced-hyperion-research/). This research collaboration of astrophysicists, statisticians and
