spfa {spfa} | R Documentation |
Fitting Semi-parametric Factor Analysis Model
Description
spfa
fits a unidimensional or two-dimension factor analysis spfa model
using penalized maximum likelihood estimation. A unidimensional spfa model can
handle discrete response data (i.e., item responses including binary responses
and polytomous responses) or continuous response data (e.g., response time).
A two-dimensional spfa
model can only handle simple structure model
with two latent factors load to continuous and discrete response data, respectively.
Usage
spfa(
data,
dimension = rep(0, ncol(data)),
discrete = rep(FALSE, ncol(data)),
control = list()
)
Arguments
data |
a matrix that consists of item responses with missing data coded as |
dimension |
a vector of integers containing indicators of the latent factor. The default is |
discrete |
a vector of |
control |
a list containing technical parameters for estimation. May be:
|
Value
a list including spfa model parameter estimates and marginal log-likelihood.
References
Liu, Y., & Wang, W. (2022). Semiparametric Factor Analysis for Item-Level Response Time Data. Psychometrika, 87(2), 666–692. doi:10.1007/s11336-021-09832-8
Liu, Y., & Wang, W. (2023). What Can We Learn from a Semiparametric Factor Analysis of Item Responses and Response Time? An Illustration with the PISA 2015 Data. Retrieved from https://arxiv.org/abs/2303.10079
Examples
# load item response time data
RT <- spfa::simdata[,1:8]
# Fit a unidimensional spfa model with continuous data (Response time)
spfa_example <- spfa(data = RT,
dimension = rep(0, ncol(RT)),
discrete = rep(FALSE, ncol(RT)))
# In the spfa pacakge, the output of spfa_example can be directly extracted.
# See example code below:
spfa::spfa_example$shortpar
# Visualize the result for item 1 as an example
plotitem.cont(spfa::spfa_example$par[[1]])