fastudy | R Documentation |
Functions for examining the dimensionality of a data set via
exploratory factor analysis. fastudy
is currently a simple
wrapper for factanal. plot.fastudy
generates a scree plot
using fastudy
output.
fastudy(x, factors, covmat, complete = TRUE, ...)
## S3 method for class 'fastudy'
plot(x, ylim, h = 1, ...)
x |
matrix or data.frame of scored item responses, one row per person, one column per item. |
factors |
the number of factors to extract. |
covmat |
optional covariance matrix. Not used if |
complete |
logical with default |
... |
further arguments passed to or from other functions. |
ylim |
vector of limits for y-axis in the scree plot, passed to |
h |
y-axis value specifying a horizonal line the scree plot, passed to
|
fastudy
runs an exploratory factor analysis using the
factanal
function, and returns a matrix of factor loadings. The
print method displays eigenvalues and proportion of variance explained
per factor.
# Exploratory factor analysis of the PISA approaches to learning scale
# Create vector of item names
items <- c("st27q01", "st27q03", "st27q05", "st27q07", "st27q04",
"st27q08", "st27q10", "st27q12", "st27q02", "st27q06",
"st27q09", "st27q11", "st27q13")
# Reduce PISA09 to complete data for Great Britain
pisa_gbr <- na.omit(PISA09[PISA09$cnt == "GBR", items])
# Fit EFA with six factors
fa_al <- fastudy(pisa_gbr, factors = 6)
# Scree plot
plot(fa_al, ylim = c(0, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.