Description Usage Arguments Examples
lmer.fit function for the single correlation template model
1 | lmerCorr.fit(y, mmFE, corr, grp, weights, offset = numeric(n), REML = TRUE)
|
y |
response vector |
mmFE |
model matrix for the fixed effects |
corr |
template correlation matrix for the single scalar random effect |
grp |
grouping factor for the random effect (levels
correspond to |
weights |
weights |
offset |
offset |
REML |
should restricted maximum likelihood be used? |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(lme4pureR)
library(lme4)
library(minqa)
library(subscript)
library(rmv)
set.seed(1)
n <- 100
x <- rnorm(n)
X <- cbind(1, x)
grp <- gl(n/5,5)
ugrps <- unique(grp)
q <- length(ugrps)
corr <- rcov(q+1,q)
dimnames(corr) <- rep(list(as.character(ugrps)), 2)
b <- as.numeric(rmv(1,corr) %*% as(grp, "sparseMatrix"))
y <- as.numeric(X%*%rnorm(ncol(X)) + b + rnorm(n))
m <- lmerCorr.fit(y, X, corr, grp)
m$par
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.