pcfa | R Documentation |
PCFA
is a partially confirmatory approach covering a wide range of
the exploratory-confirmatory continuum in factor analytic models (Chen, Guo, Zhang, & Pan, 2021).
The PCFA is only for continuous data, while the generalized PCFA (GPCFA; Chen, 2021)
covers both continuous and categorical data.
There are two major model variants with different constraints for identification. One assumes local
independence (LI) with a more exploratory tendency, which can be also called the E-step.
The other allows local dependence (LD) with a more confirmatory tendency, which can be also
called the C-step. Parameters are obtained by sampling from the posterior distributions with
the Markov chain Monte Carlo (MCMC) techniques. Different Bayesian Lasso methods are used to
regularize the loading pattern and LD. The estimation results can be summarized with summary.lawbl
and the factorial eigenvalue can be plotted with plot_lawbl
.
pcfa( dat, Q, LD = TRUE, cati = NULL, cand_thd = 0.2, PPMC = FALSE, burn = 5000, iter = 5000, update = 1000, missing = NA, rfit = TRUE, sign_check = FALSE, sign_eps = -0.5, rs = FALSE, auto_stop = FALSE, max_conv = 10, rseed = 12345, digits = 4, alas = FALSE, verbose = FALSE )
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.
Elements are 1, -1, and 0 for specified, unspecified, and zero-fixed loadings, respectively. For models with
LI or the E-step, one can specify a few (e.g., 2) loadings per factor. For models with LD or the C-step, the
sufficient condition of one specified loading per item is suggested, although there can be a few items
without any specified loading. See |
LD |
logical; |
cati |
The set of categorical (polytomous) items in sequence number (i.e., 1 to J);
|
cand_thd |
Candidate parameter for sampling the thresholds with the MH algorithm. |
PPMC |
logical; |
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. |
missing |
Value for missing data (default is |
rfit |
logical; |
sign_check |
logical; |
sign_eps |
minimum value for switch sign of loading vector (if |
rs |
logical; |
auto_stop |
logical; |
max_conv |
maximum consecutive number of convergence for auto stop. |
rseed |
An integer for the random seed. |
digits |
Number of significant digits to print when printing numeric values. |
alas |
logical; for adaptive Lasso or not. The default is |
verbose |
logical; to display the sampling information every
|
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., Guo, Z., Zhang, L., & Pan, J. (2021). A partially confirmatory approach to scale development with the Bayesian Lasso. Psychological Methods. 26(2), 210–235. DOI: 10.1037/met0000293.
Chen, J. (2021). A generalized partially confirmatory factor analysis framework with mixed Bayesian Lasso methods. Multivariate Behavioral Research. DOI: 10.1080/00273171.2021.1925520.
##################################################### # Example 1: Estimation with continuous data & LD # ##################################################### dat <- sim18cfa1$dat J <- ncol(dat) K <- 3 Q<-matrix(-1,J,K); Q[1:6,1]<-Q[7:12,2]<-Q[13:18,3]<-1 m0 <- pcfa(dat = dat, Q = Q, LD = TRUE,burn = 2000, iter = 2000) summary(m0) # summarize basic information summary(m0, what = 'qlambda') #summarize significant loadings in pattern/Q-matrix format summary(m0, what = 'offpsx') #summarize significant LD terms ###################################################### # Example 2: Estimation with categorical data & LI # ###################################################### dat <- sim18ccfa40$dat J <- ncol(dat) K <- 3 Q<-matrix(-1,J,K); Q[1:2,1]<-Q[7:8,2]<-Q[13:14,3]<-1 m1 <- pcfa(dat = dat, Q = Q,LD = FALSE,cati=-1,burn = 2000, iter = 2000) summary(m1) # summarize basic information summary(m1, what = 'qlambda') #summarize significant loadings in pattern/Q-matrix format summary(m1, what = 'offpsx') #summarize significant LD terms summary(m1,what='thd') #thresholds for categorical items
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.