if (FALSE) {
# Measurement error analysis on simulated data of fish shapes
data(fishy)
fishy$coordsarray <- arrayspecs(fishy$coords, p = 11, k = 2) #make 3D array
# Example two digitization replicates of the same research subjects
rep1 <- matrix(fishy$coords[1,], 11, 2, byrow = TRUE)
rep2 <- matrix(fishy$coords[61,], 11, 2, byrow = TRUE)
plot(rep1, pch = 16, col = gray(0.5, alpha = 0.5), cex = 2, asp = 1)
points(rep2, pch = 16, col = gray(0.2, alpha = 0.5), cex = 2, asp = 1)
# Analysis unconcerned with groups
ME1 <- gm.measurement.error(
coords = "coordsarray",
subjects = "subj",
replicates = "reps",
data = fishy)
anova(ME1)
ICCstats(ME1, subjects = "Subjects", with_in = "Systematic ME")
plot(ME1)
# Analysis concerned with groups
ME2 <- gm.measurement.error(
coords = "coordsarray",
subjects = "subj",
replicates = "reps",
groups = "groups",
data = fishy)
anova(ME2)
ICCstats(ME2, subjects = "Subjects",
with_in = "Systematic ME", groups = "groups")
P <- plot(ME2)
focusMEonSubjects(P, subjects = 18:20, shadow = TRUE)
#heat map of inter-subject variability
int.var <- interSubVar(ME2, type = "var")
plot(int.var)
}
Run the code above in your browser using DataLab