Socket
Book a DemoInstallSign in
Socket

mixed_models

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mixed_models

0.1.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

mixed_models

Build Status

Fit statistical (linear) models with fixed and mixed (random) effects in Ruby.

Features

Linear mixed models

  • Support for the formula language of the R package lme4 makes model specification convenient and user friendly. An expanation of the lme4 formula interface can be found in the lme4 vignette, or on stackexchange (example). Types of linear mixed models that can be fit by mixed_models with the formula interface include:

    • Models with interaction fixed or random effects (e.g. y ~ x + z + x:z + (x + z + x:z | g)),
    • Models with multiple crossed random effects (e.g. y ~ x + (x|g) + (x|h)),
    • Models with nested random effects (e.g. y ~ x + (x|g) + (x|g:h)).
  • Flexible model specification capabilities with the possibility to pass the random effects covariance structure as a Proc, when fitting a model from raw madel matrices.

  • Possibility of singular fits (i.e models with random effects variance equal to zero).

  • Likelihood ratio test for nested models (Chi squared or bootstrap based).

  • Many types of hypotheses tests for the fixed and random effects (based on LRT, bootstrap or the Wald Z statistic).

  • Four types of bootstrap confidence intervals for the fixed effects coefficient estimates, as well as Wald Z confidence intervals. All bootstrap based methods are performed in parallel by default.

  • Prediction on new data and prediction intervals.

Installation

To install the latest stable version:

$ gem install mixed_models

Alternatively, you can add the line gem 'mixed_models' to your application's Gemfile, and then execute:

$ bundle

Ruby is required in version >=2.0 because keyword arguments are excessively used in mixed_models.

Usage

Linear mixed models (LMM) tutorials

Analysis of real data

  • This IRuby notebook shows an application of mixed_models to real data, which originate from blog posts from various sources in 2010-2012. The analyzed data set is of nontrivial size (~50000x300) and nontrivial structure (redundant variables, missing values, data transformations, etc.).

More usage examples

Some other examples in form of Ruby code can be found in the examples folder.

Further examples can be found in several BLOG posts (see below).

Some relevant BLOG posts

Development

The development version of mixed_models can be installed using the command line:

git clone https://github.com/agisga/mixed_models.git
cd mixed_models/
bundle install
bundle exec rake install

The automatic tests can be run with bundle exec rspec spec.

Contributing

FAQs

Package last updated on 30 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.