https://github.com/aloy/lmeresampler

R package for resampling multilevel models

https://github.com/aloy/lmeresampler

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    3 of 10 committers (30.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.3%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

R package for resampling multilevel models

Basic Info
Statistics
  • Stars: 38
  • Watchers: 3
  • Forks: 7
  • Open Issues: 8
  • Releases: 3
Created about 12 years ago · Last pushed about 2 years ago
Metadata Files
Readme

README.Rmd

---
output: github_document
---

# lmeresampler 

[![R-CMD-check](https://github.com/aloy/lmeresampler/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/aloy/lmeresampler/actions/workflows/R-CMD-check.yaml)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/lmeresampler)](https://cran.r-project.org/package=lmeresampler)
![CRAN_Downloads_Badge](http://cranlogs.r-pkg.org/badges/lmersesampler)



```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
```


The `lme4` and `nlme` packages have made fitting nested linear mixed-effects models quite easy. Using the functionality of these packages we can easily use maximum likelihood or restricted maximum likelihood to fit our model and conduct inference using our parametric toolkit. In practice, the assumptions of our model are often violated to such a degree that leads to biased estimators and incorrect standard errors. In these situations, resampling methods such as the bootstrap can be used to obtain consistent estimators of the bias and standard errors for inference. `lmeresampler` provides an easy way to bootstrap nested linear-mixed effects models using the parametric, residual, cases, wild, or random effects block (REB) bootstraps fit using either `lme4` or `nlme`. The output from `lmeresampler` is an `lmeresamp` object. Moreover, the `lmeresampler` package has its own `print()`, `summary()`, `confint()`, and `plot()` functions. All of these functions follow the syntax of generic `print()`, `summary()`, `confint()`, and `plot()` functions; thus, the commands may be used with `lmeresamp` objects. 

## Installation

You can install the latest released version from CRAN with:

```{r eval=FALSE}
install.packages("lmeresampler")
```

or the latest development version from GitHub:

```{r eval=FALSE}
if(!require(devtools)) install.packages("devtools")
devtools::install_github("aloy/lmeresampler")
```

## Usage

Below is a short example of how to execute a parametric bootstrap for models fit either by `lme4` or by `nlme`. For a complete guide outlining the purpose of `lmeresampler`, the structure of `lmeresamp` objects, each of the bootstrap types, how to implement parallelization with `bootstrap()` calls, directions for future developers, and examples, please see the package vignette, available on the `lmeresampler` website. 

First, fit the necessary model(s) with the LME package of your choice. Here we show the same model fit first with `lme4`, then with `nlme`:

```{r, results = FALSE, message = FALSE}
library(lmeresampler)

library(lme4)
vcmodA <- lmer(mathAge11 ~ mathAge8 + gender + class + (1 | school), data = jsp728)

library(nlme)
vcmodB <- lme(mathAge11 ~ mathAge8 + gender + class, random = ~1|school, data = jsp728)
```

Now, to perform a parametric bootstrap, first specify the model to be used, then the function to return the parameters of interest, then `type = "parametric`, and finally, the number of bootstrap resamples to be computed:

```{r}
# let's set .f = fixef to specify that we want only the fixed effects bootstrapped

# lme4
lmer_par_boot <- bootstrap(vcmodA, .f = fixef, type = "parametric", B = 100)

# nlme
lme_par_boot  <- bootstrap(vcmodB, .f = fixef, type = "parametric", B = 100)
```

The four other bootstrap types (residual, cases, wild, and REB) may be executed in a similar way, with some minor changes. 

## References

A full list of references may be found in the package vignette.

Owner

  • Name: adam loy
  • Login: aloy
  • Kind: user
  • Company: Carleton College

GitHub Events

Total
  • Watch event: 1
  • Issue comment event: 1
Last Year
  • Watch event: 1
  • Issue comment event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 736
  • Total Committers: 10
  • Avg Commits per committer: 73.6
  • Development Distribution Score (DDS): 0.591
Past Year
  • Commits: 17
  • Committers: 2
  • Avg Commits per committer: 8.5
  • Development Distribution Score (DDS): 0.176
Top Committers
Name Email Commits
adam l****1@g****m 301
Spenser Steele s****e@g****m 262
Jenna Korobova k****j@c****u 112
IlmariTamminen 6****n 35
aloy a****y@c****u 9
Jenna Korobova j****a@m****t 7
Jenna Korobova j****a@J****l 3
adam l****a@m****u 3
Jenna Korobova j****a@M****l 3
Koen Niemeijer k****r@k****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 19
  • Total pull requests: 17
  • Average time to close issues: about 1 year
  • Average time to close pull requests: 12 days
  • Total issue authors: 16
  • Total pull request authors: 4
  • Average comments per issue: 1.84
  • Average comments per pull request: 0.41
  • Merged pull requests: 15
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jradinger (2)
  • DInfanger (2)
  • aloy (2)
  • djhunter (1)
  • Sannemalee (1)
  • ecamo19 (1)
  • bachlaw (1)
  • itchyshin (1)
  • baeyc (1)
  • NamLQ (1)
  • henrikibster (1)
  • yasinalt (1)
  • cooperr11 (1)
  • Generalized (1)
  • allefeld (1)
Pull Request Authors
  • IlmariTamminen (7)
  • aloy (6)
  • korobovaj (4)
  • koenniem (1)
Top Labels
Issue Labels
bug (4)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 455 last-month
  • Total docker downloads: 21,613
  • Total dependent packages: 2
  • Total dependent repositories: 1
  • Total versions: 7
  • Total maintainers: 1
cran.r-project.org: lmeresampler

Bootstrap Methods for Nested Linear Mixed-Effects Models

  • Versions: 7
  • Dependent Packages: 2
  • Dependent Repositories: 1
  • Downloads: 455 Last month
  • Docker Downloads: 21,613
Rankings
Stargazers count: 8.5%
Forks count: 8.8%
Average: 16.7%
Dependent packages count: 17.7%
Downloads: 24.1%
Dependent repos count: 24.4%
Maintainers (1)
Last synced: 12 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • HLMdiag * imports
  • Matrix * imports
  • dplyr >= 0.8.0 imports
  • forcats * imports
  • ggdist * imports
  • ggplot2 * imports
  • magrittr * imports
  • nlmeU * imports
  • purrr * imports
  • statmod * imports
  • stats * imports
  • tibble * imports
  • tidyr * imports
  • doParallel * suggests
  • foreach * suggests
  • knitr * suggests
  • lme4 >= 1.1 suggests
  • mlmRev * suggests
  • nlme * suggests
  • rmarkdown * suggests
  • testthat * suggests
revdep/library.noindex/lmeresampler/new/lmeresampler/DESCRIPTION cran
  • R >= 3.5.0 depends
  • HLMdiag * imports
  • Matrix * imports
  • catchr * imports
  • dplyr >= 0.8.0 imports
  • forcats * imports
  • ggdist * imports
  • ggplot2 * imports
  • magrittr * imports
  • nlmeU * imports
  • purrr * imports
  • statmod * imports
  • stats * imports
  • doParallel * suggests
  • foreach * suggests
  • knitr * suggests
  • lme4 >= 1.1 suggests
  • mlmRev * suggests
  • nlme * suggests
  • rmarkdown * suggests
  • testthat * suggests
revdep/library.noindex/lmeresampler/old/lmeresampler/DESCRIPTION cran
  • R >= 3.1.2 depends
  • Matrix * imports
  • RLRsim * imports
  • boot * imports
  • dplyr >= 0.8.0 imports
  • nlmeU * imports
  • plyr * imports
  • lme4 >= 1.1 suggests
  • mlmRev * suggests
  • nlme * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite