getVC: Fixed effect variance/sd estimates from linear mixed model

View source: R/getVC.R

getVCR Documentation

Fixed effect variance/sd estimates from linear mixed model

Description

Fixed effect variance/sd estimates from linear mixed model

Usage

getVC(model, round = 2)

Arguments

model

lmer fitted model.

round

Rounding for numbers (default 2).

Value

A formatted data frame of random effect variance/sd estimates.

Examples

set.seed(234)
n1 <- 3 # groups
n2 <- 3 # observations per groups
dat <- data.frame(
  group = rep(c(LETTERS[1:n1]), each = n2),
  x1 = sample(1:5, n1 * n2, replace = TRUE),
  x2 = sample(1:5, n1 * n2, replace = TRUE),
  x3 = sample(1:5, n1 * n2, replace = TRUE)
)
library(lme4)
getVC(lmer(x1 ~ x2 + x3 + (x3 | group),
  data = dat, REML = FALSE,
  control = lmerControl(
    optimizer = "bobyqa",
    optCtrl = list(maxfun = 2e5)
  )
))

vjilmari/vjihelpers documentation built on May 23, 2022, 6:43 p.m.