lmerAll: lmerAll is not a user level function

Description Usage Arguments Author(s) Examples

Description

lmerAll is not a user level function

Usage

1

Arguments

z

Author(s)

Yimen Araya

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## The function is currently defined as
function (z) 
{
data <- z
modF <- lmer(y~x + (x|Series) + (x|Ind), data=data, REML=TRUE)
modIDS <- lmer(y~x + (x|Series) + (1|Ind), data=data, REML=TRUE)
modIDInt <- lmer(y~x + (x|Series), data=data, REML=TRUE)

d1<- (-2*logLik(modIDInt)) + (2*logLik(modIDS))
d2<- (-2*logLik(modIDS)) + (2*logLik(modF))

pwI <-0.5*pchisq(d1[1], 0, lower.tail=FALSE) + 0.5*pchisq(d1[1], 1, lower.tail=FALSE)
pwS <-0.5*pchisq(d2[1], 1, lower.tail=FALSE) + 0.5*pchisq(d2[1], 2, lower.tail=FALSE)

vcs<- VarCorr(modF)
VCVID <- as.vector(vcs$Ind[,])
VCVSeries <- as.vector(vcs$Series[,])
Residuals <- summary(modF)$sigma^2
Intercept <-  summary(modF)$coef[1,1]
Slope <- summary(modF)$coef[2,1]
RInt <- vcs$Ind[1,1]/(vcs$Series[1,1]+vcs$Ind[1,1])
RSlope <- vcs$Ind[2,2]/(vcs$Series[2,2]+vcs$Ind[2,2])
Rrn <- (vcs$Ind[1,1] + vcs$Ind[2,2] + (2*vcs$Ind[2,1]))/((vcs$Series[1,1] + 
vcs$Series[2,2] + (2*vcs$Series[2,1])) + (vcs$Ind[1,1] + vcs$Ind[2,2] + (2*vcs$Ind[2,1])))
list(VCVSeries, VCVID, pwI, pwS, RInt, RSlope, Rrn, Residuals, Intercept, Slope)
  }

MultiRR documentation built on May 1, 2019, 8:42 p.m.