Description Usage Arguments Value References Examples
Computes the average eigenvalues produced by a Monte Carlo simulation that
randomly generates a large number of n
xp
matrices of standard
normal deviates.
1 | horns_curve(data, n, p, nsim = 1000L)
|
data |
A matrix or data frame. |
n |
Integer specifying the number of rows. |
p |
Integer specifying the number of columns. |
nsim |
Integer specifying the number of Monte Carlo simulations to run.
Default is |
A vector of length p
containing the averaged eigenvalues. The
values can then be plotted or compared to the true eigenvalues from a dataset
for a dimensionality reduction assessment.
J. L. Horn, "A rationale and test for the number of factors in factor analysis," Psychometrika, vol. 30, no. 2, pp. 179-185, 1965.
1 2 3 4 5 | # Perform Horn's Parallel analysis with matrix n x p dimensions
x <- matrix(rnorm(200 * 10), ncol = 10)
horns_curve(x)
horns_curve(n = 200, p = 10)
plot(horns_curve(x)) # scree plot
|
[1] 1.4074757 1.2782029 1.1791177 1.0959289 1.0206053 0.9481376 0.8780448
[8] 0.8090176 0.7389641 0.6557594
[1] 1.4046595 1.2751735 1.1786636 1.0948319 1.0175945 0.9461657 0.8781202
[8] 0.8102156 0.7399553 0.6566640
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.