All Projects → JuliaStats → Mixedmodels.jl

JuliaStats / Mixedmodels.jl

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

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to Mixedmodels.jl

php-statistics
Statistics library for PHP
Stars: ✭ 32 (-87.55%)
Mutual labels:  statistics
phpstats
CLI Statistics and dependency graphs for PHP
Stars: ✭ 61 (-76.26%)
Mutual labels:  statistics
bigstatsr
R package for statistical tools with big matrices stored on disk.
Stars: ✭ 139 (-45.91%)
Mutual labels:  statistics
Probability Theory
A quick introduction to all most important concepts of Probability Theory, only freshman level of mathematics needed as prerequisite.
Stars: ✭ 25 (-90.27%)
Mutual labels:  statistics
craft-retour
Retour allows you to intelligently redirect legacy URLs, so that you don't lose SEO value when rebuilding & restructuring a website
Stars: ✭ 32 (-87.55%)
Mutual labels:  statistics
GeostatisticsLessonsNotebooks
These are python notebooks accompanying Lessons available at GeostatisticsLessons.com
Stars: ✭ 28 (-89.11%)
Mutual labels:  statistics
growthbook
Open Source Feature Flagging and A/B Testing Platform
Stars: ✭ 2,342 (+811.28%)
Mutual labels:  statistics
stats
📊 Request statistics middleware that stores response times, status code counts, etc
Stars: ✭ 15 (-94.16%)
Mutual labels:  statistics
mode-line-stats
A bunch of easy to set up stats for the Emacs mode-line.
Stars: ✭ 27 (-89.49%)
Mutual labels:  statistics
highdim
Statistics for high-dimensional data (homogeneity, sphericity, independence, spherical uniformity)
Stars: ✭ 16 (-93.77%)
Mutual labels:  statistics
wp-analytify
Google Analytics Dashboard Plugin For WordPress By Analytify
Stars: ✭ 20 (-92.22%)
Mutual labels:  statistics
Mixpanel-Statistics
Perform statistics on Mixpanel API data
Stars: ✭ 26 (-89.88%)
Mutual labels:  statistics
MojangSharp
A C# wrapper library for Mojang API (no longer actively maintained)
Stars: ✭ 38 (-85.21%)
Mutual labels:  statistics
teach-r-online
Materials for the Teaching statistics and data science online workshops in July 2020
Stars: ✭ 52 (-79.77%)
Mutual labels:  statistics
fairlens
Identify bias and measure fairness of your data
Stars: ✭ 51 (-80.16%)
Mutual labels:  statistics
mortAAR
R Package - Analysis of Archaeological Mortality Data
Stars: ✭ 13 (-94.94%)
Mutual labels:  statistics
covid19 statistics
Aplicação para acompanhamento das estatísticas do COVID-19 no Brasil 🦠
Stars: ✭ 34 (-86.77%)
Mutual labels:  statistics
craft-commerce-widgets
Insightful widgets for Craft CMS Commerce stores
Stars: ✭ 33 (-87.16%)
Mutual labels:  statistics
NNS
Nonlinear Nonparametric Statistics
Stars: ✭ 26 (-89.88%)
Mutual labels:  statistics
renko trend following strategy catalyst
Example of adaptive trend following strategy based on Renko
Stars: ✭ 65 (-74.71%)
Mutual labels:  statistics

Mixed-effects models in Julia

Documentation Citation Build Status Code Coverage
Stable Docs Dev Docs DOI Tier 1 Tier 2 PkgEval CodeCov

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 Supported Platforms

OS OS Version Arch Julia Tier
Linux Ubuntu 18.04 x64 v1.4, 1.5 1
macOS Catalina 10.15 x64 v1.4, 1.5 1
Windows Server 2019 x64 v1.4, 1.5 1

Upon release of the next Julia LTS, Tier 1 will become Tier 2 and Julia LTS will become Tier 1.

Version 3.0.0

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

Please see NEWS for a complete overview. The most dramatic user-facing change is a re-working of parametricbootstrap for speed and convenience. Additionally, several formula features have been added and the handling of rank deficiency has changed.

Quick Start

julia> using MixedModels

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

Variance components:
            Column   VarianceStd.Dev.
batch    (Intercept)  1388.33 37.2603
Residual              2451.25 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

julia> propertynames(bs)
13-element Vector{Symbol}:
 :allpars
 :objective
 :σ
 :β
 :se
 :coefpvalues
 :θ
 :σs
 :λ
 :inds
 :lowerbd
 :fits
 :fcnames

julia> bs.coefpvalues # returns a row table
1000-element Vector{NamedTuple{(:iter, :coefname, :β, :se, :z, :p), Tuple{Int64, Symbol, Float64, Float64, Float64, Float64}}}:
 (iter = 1, coefname = Symbol("(Intercept)"), β = 1517.0670832927115, se = 20.76271142094811, z = 73.0669059804057, p = 0.0)
 (iter = 2, coefname = Symbol("(Intercept)"), β = 1503.5781855888436, se = 8.1387737362628, z = 184.7425956676446, p = 0.0)
 (iter = 3, coefname = Symbol("(Intercept)"), β = 1529.2236379016574, se = 16.523824785737837, z = 92.54659001356465, p = 0.0)
 ⋮
 (iter = 998, coefname = Symbol("(Intercept)"), β = 1498.3795009457242, se = 25.649682012258104, z = 58.417079019913054, p = 0.0)
 (iter = 999, coefname = Symbol("(Intercept)"), β = 1526.1076747922416, se = 16.22412120273579, z = 94.06411945042063, p = 0.0)
 (iter = 1000, coefname = Symbol("(Intercept)"), β = 1557.7546433870125, se = 12.557577103806015, z = 124.04898098653763, p = 0.0)

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) │ 1517.07 │ 20.7627 │ 73.0669 │ 0.0     │
│ 2    │ 2     │ (Intercept) │ 1503.58 │ 8.13877 │ 184.743 │ 0.0     │
│ 3    │ 3     │ (Intercept) │ 1529.22 │ 16.5238 │ 92.5466 │ 0.0     │
⋮
│ 998  │ 998   │ (Intercept) │ 1498.38 │ 25.6497 │ 58.4171 │ 0.0     │
│ 999  │ 999   │ (Intercept) │ 1526.11 │ 16.2241 │ 94.0641 │ 0.0     │
│ 1000 │ 1000  │ (Intercept) │ 1557.75 │ 12.5576 │ 124.049 │ 0.0     │

julia> DataFrame(bs.β)
1000×3 DataFrame
│ Row  │ iter  │ coefname    │ β       │
│      │ Int64 │ Symbol      │ Float64 │
├──────┼───────┼─────────────┼─────────┤
│ 1    │ 1     │ (Intercept) │ 1517.07 │
│ 2    │ 2     │ (Intercept) │ 1503.58 │
│ 3    │ 3     │ (Intercept) │ 1529.22 │
⋮
│ 998  │ 998   │ (Intercept) │ 1498.38 │
│ 999  │ 999   │ (Intercept) │ 1526.11 │
│ 1000 │ 1000  │ (Intercept) │ 1557.75 │

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".

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].