mapTest | R Documentation |
Perform Velicer's Minimum Average Partial test for the variables (usually items) in a data frame.
mapTest(data, n = 20, ...)
## S3 method for class 'mapTest'
print(x, ...)
data |
a data frame containing the variables (items) to be analyzed |
n |
the maximum number of factors to consider (default: 20) |
... |
ignored |
x |
a mapTest object |
The plot
method produces a graphical representation of the squared correlations.
A vector of class 'mapTest' containing the average squared (partial) correlations. The first element of the vector is the average squared correlation with no component removed.
Computation: William Revelle, see psych
, specifically VSS
.
Plot: Michael Hock, michael.hock@uni-bamberg.de
Velicer, W. (1976) Determining the number of components from the matrix of partial correlations. Psychometrika, 41, 321-327.
local({
set.seed(1234)
#
# Simulate 2 factors (f1, f2) underlying 6 items (x1 to x6).
#
n <- 200
f1 <- rnorm(n)
f2 <- rnorm(n)
Df <- data.frame(x1 = f1 + rnorm(n),
x2 = f1 + rnorm(n),
x3 = f1 + rnorm(n),
x4 = f2 + rnorm(n),
x5 = f2 + rnorm(n),
x6 = f2 + rnorm(n))
mt <- mapTest(Df)
print(mt)
plot(mt)
#
# If we remove 1 item the MAP test suggests the wrong number of factors...
#
Df2 <- dplyr::select(Df, -6)
mt2 <- mapTest(Df2)
print(mt2)
plot(mt2)
factanal(Df2, 2)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.