Mixed Effects Models in Julia

Author

Phillip Alday

This website contains the course materials for an introduction to mixed effects models in Julia using MixedModels.jl.

Prerequisites

The material here assumes a basic proficiency with the Julia language, including a working Julia installation with Julia 1.9+.

Installation of course materials

Julia packages used in the examples

The source code for everything can be downloaded from GitHub. After downloading the materials, you should install the necessary Julia packages.

Tip

When copying and pasting into the Julia REPL, you don’t need to remove the julia> prompt from the examples. The Julia REPL will detect the prompt and strip it for you.

Feel free to skip the movielens_download step – the relevant examples are provided only to show scaling with very large datasets.

~/economics2024$ julia

julia> using Pkg

julia> Pkg.activate(".")
  Activating project at `~/economics2024`

julia> Pkg.instantiate()
< lots of output >

julia> using Econ2024

julia> Econ2024.movielens_download() # note: this is a very large dataset!
[ Info: Downloading data
[ Info: Extracting and saving ratings
[ Info: Extracting movies that are in the ratings table
[ Info: Extracting and saving README
2-element Vector{String}:
 "~/.julia/scratchspa" ⋯ 28 bytes ⋯ "3d4d5d689f47/data/ratings.arrow"
 "~/.julia/scratchspa" ⋯ 27 bytes ⋯ "-3d4d5d689f47/data/movies.arrow"

julia> exit()

If your receive a precompilation error for RCall or JellyMe4, you won’t be able to use those packages, but should be able complete all other examples. The most likely cause of the precompilation error is a problem with RCall’s configuration for using R from within Julia.

Important

Please check that you have the most recent version of the materials directly before the course.

Rendering the course website

This repository uses Quarto with the Julia code execution supplied by QuartoNotebookRunner.jl, which requires Quarto 1.5+.

As of early May 2024, Quarto 1.5 is only available as a preview release, which you’ll need to download from GitHub. Under each release’s “Assets”, you can find platform-specific installers.

Tip

You don’t need to install or use quarto to view the course materials. Everything, including the example code, is visible on the website, with links to the underlying source code for the entire page.

~/economics2024$ quarto preview

< lots of output >

This page was rendered from git revision 4fbf435 .