mixedmodels.jl

A Julia package for fitting (statistical) mixed-effects models

https://github.com/juliastats/mixedmodels.jl

Science Score: 36.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
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.3%) to scientific vocabulary

Keywords

julia mixed-effects mixed-models statistical-models statistics

Keywords from Contributors

literate-programming scientific-reports flux the-human-brain graphics particles lyapunov-spectrum geometry billiards billiard-systems

Scientific Fields

Economics Social Sciences - 40% confidence
Last synced: 4 months ago · JSON representation

Repository

A Julia package for fitting (statistical) mixed-effects models

Basic Info
Statistics
  • Stars: 432
  • Watchers: 18
  • Forks: 49
  • Open Issues: 54
  • Releases: 144
Topics
julia mixed-effects mixed-models statistical-models statistics
Created almost 13 years ago · Last pushed 4 months ago
Metadata Files
Readme Changelog License Zenodo

README.md

Mixed-effects models in Julia

|Documentation|Citation|Build Status|Code Coverage| Style Guide | |:---------------:|:----------:|:--------------:|:---------------:|:----------------| |Stable Docs Dev Docs | DOI | Julia Current Julia Minimum Supported Version Julia Nightly PkgEval | CodeCov | Code Style: Blue |

This package defines linear mixed models (LinearMixedModel) and generalized linear mixed models (GeneralizedLinearMixedModel). Users can use the abstraction for statistical model API to build, fit (fit/fit!), and query the fitted models.

A mixed-effects model is a statistical model for a response variable as a function of one or more covariates. For a categorical covariate the coefficients associated with the levels of the covariate are sometimes called effects, as in "the effect of using Treatment 1 versus the placebo". If the potential levels of the covariate are fixed and reproducible, e.g. the levels for Sex could be "F" and "M", they are modeled with fixed-effects parameters. If the levels constitute a sample from a population, e.g. the Subject or the Item at a particular observation, they are modeled as random effects.

A mixed-effects model contains both fixed-effects and random-effects terms.

With fixed-effects it is the coefficients themselves or combinations of coefficients that are of interest. For random effects it is the variability of the effects over the population that is of interest.

In this package random effects are modeled as independent samples from a multivariate Gaussian distribution of the form 𝓑 ~ 𝓝(0, 𝚺). For the response vector, 𝐲, only the mean of conditional distribution, 𝓨|𝓑 = 𝐛 depends on 𝐛 and it does so through a linear predictor expression, 𝛈 = 𝐗𝛃 + 𝐙𝐛, where 𝛃 is the fixed-effects coefficient vector and 𝐗 and 𝐙 are model matrices of the appropriate sizes,

In a LinearMixedModel the conditional mean, 𝛍 = 𝔼[𝓨|𝓑 = 𝐛], is the linear predictor, 𝛈, and the conditional distribution is multivariate Gaussian, (𝓨|𝓑 = 𝐛) ~ 𝓝(𝛍, σ²𝐈).

In a GeneralizedLinearMixedModel, the conditional mean, 𝔼[𝓨|𝓑 = 𝐛], is related to the linear predictor via a link function. Typical distribution forms are Bernoulli for binary data or Poisson for count data.

Currently Tested Platforms

|OS | OS Version |Arch |Julia | |:------:|:-------------:|:------:|:--------------:| |Linux | Ubuntu 22.04 | x64 |v1.10 | |Linux | Ubuntu 24.04 | x64 |current release | |Linux | Ubuntu 22.04 | x64 |nightly | |macOS | Sonoma 14 | aarm64 |v1.10 | |macOS | Sequoia 15 | aarm64 |current release | |Windows | Server 2022 | x64 |v1.10 |

Note that previous releases still support older Julia versions.

Version 5.0

Version 5.0.0 contains some user-visible changes and many changes in the underlying code.

Please see NEWS for a complete overview, but a few key points are: - Options related to multithreading in the bootstrap have been completely removed. - Model fitting now uses unconstrained optimization, with a post-fit canonicalization step so that the diagonal elements of the lower Cholesky factor are non-negative. Relatedly, support for constrained optimization has been completely removed and the lowerbd field of OptSummary dropped. - The default optimizer has changed to use NLopt's implementation of NEWUOA. Further changes to the default optimizer are considered non-breaking. - The profile function now respects backend and optimizer settings. - The deprecated hide_progress keyword argument has been removed in favor of the shorter and affirmative progress. - A fitlog is always kept and stored as a Tables.jl-compatible column table.

Quick Start

```julia-repl julia> using MixedModels

julia> using MixedModelsDatasets: dataset

julia> m1 = lmm(@formula(yield ~ 1 + (1|batch)), dataset(:dyestuff)) Linear mixed model fit by maximum likelihood yield ~ 1 + (1 | batch) logLik -2 logLik AIC AICc BIC -163.6635 327.3271 333.3271 334.2501 337.5307

Variance components: Column Variance Std.Dev. batch (Intercept) 1388.3332 37.2603 Residual 2451.2500 49.5101 Number of obs: 30; levels of grouping factors: 6

Fixed-effects parameters: ──────────────────────────────────────────────── Coef. Std. Error z Pr(>|z|) ──────────────────────────────────────────────── (Intercept) 1527.5 17.6946 86.33 <1e-99 ────────────────────────────────────────────────

julia> using Random

julia> bs = parametricbootstrap(MersenneTwister(42), 1000, m1) Progress: 100%%|████████████████████████████████████████████████| Time: 0:00:00 MixedModelBootstrap with 1000 samples parameter min q25 median mean q75 max ┌──────────────────────────────────────────────────────────────────── 1 │ β1 1474.0 1515.62 1527.68 1527.4 1539.56 1584.57 2 │ σ 26.6353 43.7165 48.4817 48.8499 53.8964 73.8684 3 │ σ1 0.0 16.835 28.1067 27.7039 39.491 83.688 4 │ θ1 0.0 0.340364 0.561701 0.588678 0.840284 2.24396

julia> bs.coefpvalues # returns a row table

julia> using DataFrames

julia> DataFrame(bs.coefpvalues) # puts it into a DataFrame 1000×6 DataFrame Row │ iter coefname β se z p │ Int64 Symbol Float64 Float64 Float64 Float64 ──────┼───────────────────────────────────────────────────────── 1 │ 1 (Intercept) 1552.65 9.8071 158.319 0.0 2 │ 2 (Intercept) 1557.33 21.0679 73.9197 0.0 ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ 999 │ 999 (Intercept) 1503.1 30.3349 49.5501 0.0 1000 │ 1000 (Intercept) 1565.47 24.5067 63.8794 0.0 996 rows omitted ```

Funding Acknowledgement

The development of this package was supported by the Center for Interdisciplinary Research, Bielefeld (ZiF)/Cooperation Group "Statistical models for psychological and linguistic data".

Owner

  • Name: Julia Statistics
  • Login: JuliaStats
  • Kind: organization

Statistics and Machine Learning made easy in Julia

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 1,017
  • Total Committers: 25
  • Avg Commits per committer: 40.68
  • Development Distribution Score (DDS): 0.236
Top Committers
Name Email Commits
Douglas Bates d****s@g****m 777
Phillip Alday p****y@u****m 125
Dave Kleinschmidt d****t@g****m 30
Phillip Alday p****y@m****l 26
José Bayoán Santiago Calderón n****r@g****m 13
github-actions[bot] 4****]@u****m 12
Likan Zhan z****n@h****m 9
Andreas Noack a****s@n****k 4
Milan Bouchet-Valat n****n@c****r 3
Alex Arslan a****n@c****t 2
Tony Kelman t****y@k****t 2
Elliot Saba s****t@g****m 1
Antoine b****n@g****m 1
Daniel Karrasch D****h@g****e 1
Bates e****b@i****m 1
Andreas Noack a****n@g****m 1
Michael Hatherly m****y@g****m 1
SimonAB s****n@g****m 1
Yakir Luc Gagnon 1****r@g****m 1
Patrick Kofod Mogensen p****n@g****m 1
Jacob Quinn q****d@g****m 1
femtocleaner[bot] f****]@u****m 1
Morten Piibeleht m****t@g****m 1
Benedikt Ehinger b****r@u****e 1
doug B****s@I****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 93
  • Total pull requests: 217
  • Average time to close issues: 6 months
  • Average time to close pull requests: 25 days
  • Total issue authors: 37
  • Total pull request authors: 11
  • Average comments per issue: 3.65
  • Average comments per pull request: 2.47
  • Merged pull requests: 171
  • Bot issues: 0
  • Bot pull requests: 17
Past Year
  • Issues: 22
  • Pull requests: 75
  • Average time to close issues: 10 days
  • Average time to close pull requests: 2 days
  • Issue authors: 12
  • Pull request authors: 6
  • Average comments per issue: 2.55
  • Average comments per pull request: 2.48
  • Merged pull requests: 48
  • Bot issues: 0
  • Bot pull requests: 6
Top Authors
Issue Authors
  • palday (21)
  • dmbates (20)
  • ajinkya-k (6)
  • donaldRwilliams (3)
  • joseah (3)
  • yjunechoe (2)
  • kolia (2)
  • liamlundy (2)
  • likanzhan (2)
  • coverton-usgs (2)
  • ArnoStrouwen (2)
  • dhalpern (2)
  • jariji (2)
  • kliegl (1)
  • biona001 (1)
Pull Request Authors
  • palday (137)
  • dmbates (38)
  • ajinkya-k (14)
  • github-actions[bot] (9)
  • dependabot[bot] (9)
  • likanzhan (4)
  • guspan-tanadi (2)
  • kleinschmidt (1)
  • timholy (1)
  • nalimilan (1)
  • yoninazarathy (1)
Top Labels
Issue Labels
breaking (4) docs (2) bug (1) enhancement (1)
Pull Request Labels
dependencies (9) enhancement (2) bug (1) github_actions (1)

Packages

  • Total packages: 3
  • Total downloads:
    • julia 765 total
  • Total dependent packages: 14
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 494
juliahub.com: MixedModels

A Julia package for fitting (statistical) mixed-effects models

  • Versions: 116
  • Dependent Packages: 14
  • Dependent Repositories: 1
  • Downloads: 765 Total
Rankings
Stargazers count: 1.9%
Forks count: 3.1%
Average: 4.4%
Dependent packages count: 4.8%
Dependent repos count: 7.8%
Last synced: 4 months ago
proxy.golang.org: github.com/juliastats/mixedmodels.jl
  • Versions: 189
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.7%
Dependent repos count: 5.9%
Last synced: 4 months ago
proxy.golang.org: github.com/JuliaStats/MixedModels.jl
  • Versions: 189
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.5%
Average: 5.7%
Dependent repos count: 5.9%
Last synced: 4 months ago

Dependencies

.github/workflows/MKL.yml actions
  • actions/checkout v2 composite
  • julia-actions/julia-buildpkg v0.1 composite
  • julia-actions/julia-runtest v0.1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • julia-actions/julia-buildpkg v0.1 composite
  • julia-actions/julia-runtest v0.1 composite
  • julia-actions/julia-uploadcodecov v0.1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/docs-cleanup.yml actions
  • actions/checkout v2 composite
.github/workflows/documenter.yml actions
  • actions/checkout v2 composite
  • julia-actions/julia-buildpkg latest composite
  • julia-actions/julia-docdeploy latest composite
  • julia-actions/setup-julia v1 composite
.github/workflows/lts.yml actions
  • actions/checkout v2 composite
  • julia-actions/julia-buildpkg v0.1 composite
  • julia-actions/julia-runtest v0.1 composite
  • julia-actions/julia-uploadcodecov v0.1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/nightly.yml actions
  • actions/checkout v2 composite
  • julia-actions/julia-buildpkg v0.1 composite
  • julia-actions/julia-runtest v0.1 composite
  • julia-actions/julia-uploadcodecov v0.1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/style.yml actions
  • actions/checkout v1 composite
  • julia-actions/setup-julia latest composite
  • reviewdog/action-suggester v1 composite