Skip to content

davedgd/drop1parallel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drop1parallel

A parallel version of the drop1 (and stepAIC) function for R

Installation

library(devtools)
install_github("https://github.com/davedgd/drop1parallel")

Usage

library(lme4)
library(doParallel)
library(HSAUR3)
library(drop1parallel)

cl <- makePSOCKcluster(detectCores(logical = FALSE))
registerDoParallel(cl)

# basic example from ?lme4::glmer
gm2 <- glmer(outcome~ treatment + poly(visit, 2) +(1|patientID),
               data=toenail,
               family=binomial,nAGQ=20)

# for drop1, i.e., drop1(gm2):
drop1parallel(gm2, passData = toenail)

# for backwards stepwise AIC along the lines of MASS::stepAIC and others:
stepAICparallel(gm2, passData = toenail)

To-Do

  • code cleanup
  • add an option for automated polynomial reduction (e.g., cubic -> quadratic -> linear)
  • report convergence or model fit issues during stepwise reduction

About

A parallel version of the drop1 function for R

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages