fastudy: Factor Analysis Study

View source: R/fastudy.R

fastudyR Documentation

Factor Analysis Study

Description

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.

Usage

fastudy(x, factors, covmat, complete = TRUE, ...)

## S3 method for class 'fastudy'
plot(x, ylim, h = 1, ...)

Arguments

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 x is supplied.

complete

logical with default FALSE indicating whether or not x should be reduced to rows with complete data across all columns.

...

further arguments passed to or from other functions.

ylim

vector of limits for y-axis in the scree plot, passed to par.

h

y-axis value specifying a horizonal line the scree plot, passed to abline.

Value

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.

Examples


# 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))


talbano/epmr documentation built on May 1, 2024, 11:10 a.m.