fit_LMER: Fit lmer model with given fixed and random effect(s) design...

Description Usage Arguments Value Examples

View source: R/fixlmer.R

Description

Fit lmer model with given fixed and random effect(s) design matrices

Usage

1
fit_LMER(Response, X, ListZ, REML = TRUE)

Arguments

Response

n \times 1 vector of responses

X

n \times p data.frame fixed effect design matrix

ListZ

Named R list of size K, of n \times k_i data.frame random effect design matrices

REML

TRUE/FALSE of whether to use REML (FALSE = ML)

eps

control to pass to lmer

Value

a lmer model object (all functions available for lmer work on it)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
X <- data.frame(matrix(1, 1000, 1))
Z1 <- data.frame(matrix(rnorm(2*1000), 1000, 2))
Z2 <- data.frame(matrix(rnorm(3*1000), 1000, 3))
colnames(X) <- c("(Intercept)")

model <- new_lmer(Response = rnorm(1000),
                  X        = X,
                  ListZ    = list("Z1" = Z1,
                                  "Z2" = Z2))
summary(model)

devoges/fstat documentation built on May 17, 2019, 10 a.m.