boot_lme: Bootstraping for linear mixed models

View source: R/boot_lme.R

boot_lmeR Documentation

Bootstraping for linear mixed models

Description

Bootstraping tools for linear mixed-models using a consistent interface

bootstrap function for objects of class gls

Usage

boot_lme(
  object,
  f = NULL,
  R = 999,
  psim = 1,
  cores = 1L,
  data = NULL,
  verbose = TRUE,
  ...
)

boot_gls(
  object,
  f = NULL,
  R = 999,
  psim = 1,
  cores = 1L,
  data = NULL,
  verbose = TRUE,
  ...
)

Arguments

object

object of class lme or gls

f

function to be applied (and bootstrapped), default coef (gls) or fixef (lme)

R

number of bootstrap samples, default 999

psim

simulation level for vector of fixed parameters either for simulate_gls or simulate_lme

cores

number of cores to use for parallel computation

data

optional data argument (useful/needed when data are not in an available environment).

verbose

logical (default TRUE) whether to print a message if model does not converge.

...

additional arguments to be passed to function boot

Details

This function is inspired by Boot, which does not seem to work with ‘gls’ or ‘lme’ objects. This function makes multiple copies of the original data, so it can be very hungry in terms of memory use, but I do not believe this to be a big problem given the models we typically fit.

Examples


require(nlme)
require(car)
data(Orange)

fm1 <- lme(circumference ~ age, random = ~ 1 | Tree, data = Orange)
fm1.bt <- boot_lme(fm1, R = 50)

hist(fm1.bt)




nlraa documentation built on May 29, 2024, 2:01 a.m.