Five raters were asked to guess the number of points in a swarm for 10 different figures (which - unknown to the raters - were each repeated three times).
A data frame with 30 observations on the following 6 variables.
SANDThe true number of points in the swarm. Each picture is replicated thrice
MERatings from judge 1
TMRatings from judge 2
AJRatings from judge 3
BMRatings from judge 4
LORatings from judge 5
Collected by Claus Ekstrom.
The raters had approximately 10 seconds to judge each picture, and they thought it were 30 different pictures. Before starting the experiment they were shown 6 (unrelated) pictures and were told the number of points in each of those pictures. The SAND column contains the picture id (which is also the true number of points in the swarm).
library(MethComp)
data( rainman )
str( rainman )
#> 'data.frame': 30 obs. of 6 variables:
#> $ SAND: int 120 48 88 32 24 100 52 80 72 96 ...
#> $ ME : int 175 50 150 45 25 125 70 145 85 110 ...
#> $ TM : int 120 50 75 22 22 80 50 75 90 110 ...
#> $ AJ : int 105 45 75 28 25 91 48 68 55 84 ...
#> $ BM : int 100 50 60 30 20 80 45 55 60 65 ...
#> $ LO : int 100 70 80 30 20 70 50 60 60 65 ...
RM <- Meth( rainman, item=1, y=2:6 )
#> The following variables from the dataframe
#> "rainman" are used as the Meth variables:
#> item: SAND
#> y: ME TM AJ BM LO
#> #Replicates
#> Method 3 #Items #Obs: 150 Values: min med max
#> AJ 10 10 30 18 57 120
#> BM 10 10 30 15 62 120
#> LO 10 10 30 20 55 100
#> ME 10 10 30 24 90 200
#> TM 10 10 30 20 75 120
head( RM )
#> meth item repl y
#> 1 ME 120 1 175
#> 2 ME 48 1 50
#> 3 ME 88 1 150
#> 4 ME 32 1 45
#> 5 ME 24 1 25
#> 6 ME 100 1 125
BA.est( RM, linked=FALSE )
#> Error in solve.default(do.call("cbind", Xcols), apply(shifted, 2, fun, ...)): Lapack routine dgesv: system is exactly singular: U[49,49] = 0
library(lme4)
#> Loading required package: Matrix
mf <- lmer( y ~ meth + item + (1|MI),
data = transform( RM, MI=interaction(meth,item) ) )
summary( mf )
#> Linear mixed model fit by REML ['lmerMod']
#> Formula: y ~ meth + item + (1 | MI)
#> Data: transform(RM, MI = interaction(meth, item))
#>
#> REML criterion at convergence: 1169.2
#>
#> Scaled residuals:
#> Min 1Q Median 3Q Max
#> -1.9524 -0.4988 0.0296 0.4462 4.3601
#>
#> Random effects:
#> Groups Name Variance Std.Dev.
#> MI (Intercept) 82.45 9.08
#> Residual 190.85 13.81
#> Number of obs: 150, groups: MI, 50
#>
#> Fixed effects:
#> Estimate Std. Error t value
#> (Intercept) 14.540 6.395 2.274
#> methBM 2.000 5.405 0.370
#> methLO -10.400 5.405 -1.924
#> methME 34.967 5.405 6.469
#> methTM 8.400 5.405 1.554
#> item32 9.067 7.644 1.186
#> item48 24.467 7.644 3.201
#> item52 29.467 7.644 3.855
#> item72 45.933 7.644 6.009
#> item80 53.267 7.644 6.969
#> item88 62.133 7.644 8.129
#> item96 69.600 7.644 9.106
#> item100 76.133 7.644 9.960
#> item120 91.867 7.644 12.019
#>
#> Correlation matrix not shown by default, as p = 14 > 12.
#> Use print(x, correlation=TRUE) or
#> vcov(x) if you need it
mr <- lmer( y ~ (1|meth) + (1|item) + (1|MI),
data = transform( RM, MI=interaction(meth,item) ) )
summary( mr )
#> Linear mixed model fit by REML ['lmerMod']
#> Formula: y ~ (1 | meth) + (1 | item) + (1 | MI)
#> Data: transform(RM, MI = interaction(meth, item))
#>
#> REML criterion at convergence: 1293.9
#>
#> Scaled residuals:
#> Min 1Q Median 3Q Max
#> -1.9332 -0.5176 0.0071 0.4251 4.4351
#>
#> Random effects:
#> Groups Name Variance Std.Dev.
#> MI (Intercept) 82.45 9.08
#> item (Intercept) 870.62 29.51
#> meth (Intercept) 275.60 16.60
#> Residual 190.85 13.81
#> Number of obs: 150, groups: MI, 50; item, 10; meth, 5
#>
#> Fixed effects:
#> Estimate Std. Error t value
#> (Intercept) 67.73 12.05 5.622
#
# Point swarms were generated by the following program
#
if (FALSE) { # \dontrun{
set.seed(2) # Original
npoints <- sample(4:30)*4
nplots <- 10
pdf(file="swarms.pdf", onefile=TRUE)
s1 <- sample(npoints[1:nplots])
print(s1)
for (i in 1:nplots) {
n <- s1[i]
set.seed(n)
x <- runif(n)
y <- runif(n)
plot(x,y, xlim=c(-.15, 1.15), ylim=c(-.15, 1.15), pch=20, axes=F,
xlab="", ylab="")
}
s1 <- sample(npoints[1:nplots])
print(s1)
for (i in 1:nplots) {
n <- s1[i]
set.seed(n)
x <- runif(n)
y <- runif(n)
plot(y,x, xlim=c(-.15, 1.15), ylim=c(-.15, 1.15), pch=20, axes=F,
xlab="", ylab="")
}
s1 <- sample(npoints[1:nplots])
print(s1)
for (i in 1:nplots) {
n <- s1[i]
set.seed(n)
x <- runif(n)
y <- runif(n)
plot(-x,y, xlim=c(-1.15, .15), ylim=c(-.15, 1.15), pch=20, axes=F,
xlab="", ylab="")
}
dev.off()
} # }