pefa  R Documentation 
PEFA
is a partially exploratory approach to factor analysis, which can incorporate
partial knowledge together with unknown number of factors, using bilevel Bayesian regularization.
When partial knowledge is not needed, it reduces to the fully exploratory factor analysis (FEFA
; Chen, 2021).
A large number of factors can be imposed for selection where true factors will be identified against spurious factors.
The loading vector is reparameterized to tackle model sparsity at the factor and loading levels
with the multivariate spike and slab priors. Parameters are obtained by sampling from the posterior
distributions with the Markov chain Monte Carlo (MCMC) techniques. The estimation results can be summarized
with summary.lawbl
and the trace or density of the posterior can be plotted with plot_lawbl
.
pefa( dat, Q = NULL, K = 8, mjf = 3, PPMC = FALSE, burn = 5000, iter = 5000, missing = NA, eig_eps = 1, sign_eps = 0, rfit = TRUE, rs = FALSE, update = 1000, rseed = 12345, verbose = FALSE, auto_stop = FALSE, max_conv = 10, digits = 4 )
dat 
A N \times J data matrix or data.frame consisting of the responses of N individuals to J items. 
Q 
A J \times K design matrix for the loading pattern with K factors and J items for 
K 
Maximum number of factors for selection under 
mjf 
Minimum number of items per factor. 
PPMC 
logical; 
burn 
Number of burnin iterations before posterior sampling. 
iter 
Number of formal iterations for posterior sampling (> 0). 
missing 
Value for missing data (default is 
eig_eps 
minimum eigenvalue for factor extraction. 
sign_eps 
minimum value for switch sign of loading vector. 
rfit 
logical; 
rs 
logical; 
update 
Number of iterations to update the sampling information. 
rseed 
An integer for the random seed. 
verbose 
logical; to display the sampling information every

auto_stop 
logical; 
max_conv 
maximum consecutive number of convergence for auto stop. 
digits 
Number of significant digits to print when printing numeric values. 
pcfa
returns an object of class lawbl
without item intercepts. It contains a lot of information about
the posteriors that can be summarized using summary.lawbl
.
Chen, J. (2021). A Bayesian regularized approach to exploratory factor analysis in one step. Structural Equation Modeling: A Multidisciplinary Journal, 28(4), 518528. DOI: 10.1080/10705511.2020.1854763.
Chen, J. (In Press). Fully and partially exploratory factor analysis with bilevel Bayesian regularization. Behavior Research Methods.
##################################################### # Example 1: Fully EFA # ##################################################### dat < sim18cfa0$dat m0 < pefa(dat = dat, K=5, burn = 2000, iter = 2000,verbose = TRUE) summary(m0) # summarize basic information summary(m0, what = 'qlambda') #summarize significant loadings in pattern/Qmatrix format summary(m0, what = 'phi') #summarize factorial correlations summary(m0, what = 'eigen') #summarize factorial eigenvalue ########################################################## # Example 2: PEFA with two factors partially specified # ########################################################## J < ncol(dat) K < 5 Q<matrix(1,J,K); Q[1:2,1]<Q[7:8,2]<1 Q m1 < pefa(dat = dat, Q = Q,burn = 2000, iter = 2000,verbose = TRUE) summary(m1) summary(m1, what = 'qlambda') summary(m1, what = 'phi') summary(m1,what='eigen')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.