pefa: Partially Exploratory Factor Analysis

Description Usage Arguments Value References Examples

View source: R/pefa.R

Description

PEFA is a partially exploratory approach to factor analysis, which can incorporate partial knowledge together with unknown number of factors, using bi-level 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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
pefa(
  dat,
  Q = NULL,
  K = 8,
  mjf = 3,
  PPMC = FALSE,
  burn = 5000,
  iter = 5000,
  update = 1000,
  rseed = 12345,
  digits = 4,
  verbose = FALSE
)

Arguments

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 PEFA. Elements are 1, -1, and 0 for specified, unspecified, and zero-fixed loadings, respectively. It's not needed for FEFA, which is the default. See Examples.

K

Maximum number of factors for selection under FEFA. Not used for PEFA.

mjf

Minimum number of items per factor.

PPMC

logical; TRUE for conducting posterior predictive model checking.

burn

Number of burn-in iterations before posterior sampling.

iter

Number of formal iterations for posterior sampling (> 0).

update

Number of iterations to update the sampling information.

rseed

An integer for the random seed.

digits

Number of significant digits to print when printing numeric values.

verbose

logical; to display the sampling information every update or not.

  • Feigen: Eigenvalue for each factor.

  • NLA_le3: Number of Loading estimates >= .3 for each factor.

  • Shrink: Shrinkage parameter for each factor.

  • True Fa: Is the factor identified as true or not.

  • Adj PSR: Adjusted PSR for each factor.

  • ROW: LA overflow,sign switch,MJF total, current, reset: Loading overflow, sign switch, min item per factor reached and related diagnostic information.

Value

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.

References

Chen, J. (2021). A Bayesian regularized approach to exploratory factor analysis in one step. Structural Equation Modeling: A Multidisciplinary Journal. DOI: 10.1080/10705511.2020.1854763.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#####################################################
#  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/Q-matrix 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')

LAWBL documentation built on April 2, 2021, 1:05 a.m.