203 questions
Score of 0
0 answers
52 views
How to Calculate Factor Scores After Regularized Exploratory Factor Analysis? [migrated]
I am doing some psychometric analysis of a measure. Based on parallel analysis and my own theoretical interpretation, it seems like extracting two factors is the ideal solution for this measure; ...
Score of 1
0 answers
130 views
Trouble with fitting confirmatory factor models in R with lavaan [closed]
I am currently working on a scale development project. The scale is a measure of objective knowledge and therefore the variables are binary (0=incorrect answer, 1=correct answer). I want to compare a ...
Best practices
0
votes
0
replies
49
views
How should correlated-factor, higher-order, and bifactor CFA models be compared?
I am validating a new 42-item scale with 7 theoretically defined subscales. I estimated three CFA models in lavaan using MLR:
A correlated 7-factor model,
A higher-order model with one second-order ...
Score of 2
0 answers
39 views
How to fix "correlation larger than 1" in longitudinal invariance with ordered-categorical measures using Marker Variable method
I am investigating the longitudinal measurement invariance of a socio-emotional learning (SEL) measure (5 factors, 2 waves) using lavaan and the WLSMV estimator. I am following the identification ...
Score of 2
1 answer
85 views
sklearn's FactorAnalysis varimax orthogonal rotation increases correlation of factors
I'm using Scikit-Learn's FactorAnalysis in an application that relies on the assumption that the factors are uncorrelated. It would be great to have more interpretable factors, and an orthogonal ...
Score of 2
0 answers
129 views
Multiple-Group Factor Analysis Alignment in R - need to extract the factor scores
I'm trying to setup a factor which measures (it's just an example) trust in institutions. The data was registered in more than 10 regions and it would be important to have the same factor structure in ...
Score of 1
1 answer
88 views
How do you interpret the different lines on a Very Simple Structure plot? And extract the values to feed into a ggplot?
For my factor analysis, I first created a scree plot and then a Very Simple Structure (VSS) plot to help discern the appropriate number of factors to retain.
Using the psych package, here's my code to ...
Score of 0
0 answers
161 views
Variable names not fully displayed when using psych::fa.diagram for plotting
Using the example from the psych package:
library(psych)
# ? fa.diagram
f3 <- fa(Thurstone, 3, rotate="cluster")
fa.diagram(f3, cut=.4, digits=2)
f3l <- f3$loadings
fa.diagram(f3l, ...
Score of 1
2 answers
191 views
R Error in psych::polychoric() "Error in cor(x, use = "pairwise") : supply both 'x' and 'y' or a matrix-like 'x'"
I'm trying to run psych::polychoric(), but each time I get this error:
Error in cor(x, use = "pairwise") :
supply both 'x' and 'y' or a matrix-like 'x'
I'm struggling to understand why my &...
Score of 1
1 answer
117 views
Checking convergence in the results returned by the psych fa() function?
I am writing a function that will use the fa() function from the "psych" package. When fa() fails to converge, I want my function to discard the results and return an empty plot that just ...
Score of 0
0 answers
69 views
How to perform a confirmatory factor analysis
I am trying to perform a confirmatory factor analysis in R based on a data set in data.frame form. For that, I would like to calculate the loading factor (\lambda), the construct reliability (CR) and ...
Score of 2
1 answer
145 views
Psych library: factor analysis not convergence with mixed data
I want to compute factor analysis with mixed data (i.e., continous, categorical and binary) but I have a lot of warnings and it does not converge resulting in Nans ( objective num NaN,
criteria NaN NA ...
Score of 0
1 answer
64 views
How to use R package modelsummary to produce a factanal summary table
The modelsummary::supported_models() includes factanal objects, to purportedly produce a summary table of a factor analysis model.
However, the following two attempts fail
library(modelsummary)
...
Score of 3
1 answer
287 views
Why do the factor loadings from R's fa() and factanal() functions differ when using the promax rotation?
I tried to use factanal() from base R and fa() from the psych package to perform a factor analysis on data from a questionnaire with same response scale for each question.
Why do I obtain different ...
Score of 0
0 answers
168 views
Why am I seeing negative factor loadings when using the factor-analyzer module in pandas and limiting the model to 1 factor?
I am trying to learn how to perform factor analysis in Pandas using the factor-analyzer module. I'm checking my work by running the same analysis in Stata.
The initial, exploratory factor analysis ...
Score of 0
1 answer
162 views
Best way to format this data for exploratory factor analysis, using R? [closed]
I have extremely little experience with factor analysis so my question may beyond rudimentary/remedial. My question is about data formatting. I have this dataset (well, this is just the first two of ...
Score of 1
0 answers
49 views
Garch Standardization of returns-FactorAnalytics package in R
In the Garch part of the specFfm from FactorAnalytics (standardization of the returns), shoudn't the dataDT$ts[i] be lagged one period based on the basic GARCH(1,1) formula?
for ( i in 1: NROW(dataDT)...
Score of 0
0 answers
996 views
Error in lavaan::lavaan ERROR: missing observed variables in dataset: TR EW SRI VPM DELY
I'm trying to use a confirmatory factor analysis (CFA) in R studio. From what I have read online that CFA can be conducted in both categorical and continues variables. However the error message ...
Score of 1
0 answers
138 views
CFA in R: The variance-covariance matrix of the estimated parameters (vcov) does not appear to be positive definite. What is the problem?
I am trying to calculate a CFA for the Theory of Planned Behaviour (TPB). I have split the 4 factors (Attitude, SubNorm, PBC, Intention) into inverted and non-inverted items. Enclosed is the ...
Score of 0
0 answers
226 views
CFA with ordinal variables: problems with the frequencies of one observed variable
I'm running a CFA (10 factors, 103 ordinal observed variables, n=284) using lavaan library. I'm using RStudio with R version 4.2.0. This is the model:
library (lavaan)
modelshort<-'
comm=~Comm3+...
Score of 0
0 answers
435 views
Error in R `psych::polychoric` for factor analysis
I'm having some difficulty running a factor analysis of
polychoric correlations in psych. I think I've narrowed the problem down to the function polychoric(). Here's a small example:
df <- data....
Score of 1
1 answer
322 views
CFA not yielding same results as EFA in R
I am using the 'psych' package in R to run EFA. After running the EFA, I use Lavaan to run a CFA using the factor structure from EFA, purely just to humor myself to compare results. After doing so, I ...
Score of 0
1 answer
289 views
How to get the RMSEA value after a Factor analysis (psych:fa) with R?
I did a factor analysis on a database using the fa function of the R psych package :
facto <- fa(df)
I managed to retrieve the RMSEA with facto$RMSEA :
For example :
RMSEA
lower
upper
confidence
0....
Score of 2
0 answers
487 views
Avoid overlapping factor loadings when using semplot function in R
I have run a CFA in lavaan and am trying to plot the results in R. Data can be found here: https://github.com/pb865/EFBiasData/blob/main/EFdata.csv
Here is the CFA model code:
CommonEF =~ ...
Score of 2
1 answer
752 views
Why can't I do a 3 variable CFA with lavaan on R?
Everything works just fine when I have 4 variables or more. But I thought the minimum for a CFA or EFA was 3 variables. When I run the code, it gives me 0's for all the parameters that estimate if it'...
Score of 1
1 answer
325 views
How to repeat several similar named variables in lavaan model syntax easily?
Suppose we have a data frame like the one below. The numbers are irrelevant to my actual query, so I have simply given them the same value.
df <- data.frame(ABC_1 = c(1,2,3),
ABC_2 ...
Score of 1
1 answer
198 views
How does one extract the principle component scores to be used in follow up statistics using FAMD?
I do know how to get the eigenvalues, contributions, and coordinates, but where can i get the PC scores? These values are the ones that are typically produces in PCA which you use instead of the ...
Score of 1
0 answers
349 views
R: How to solve Lapack routine dgesv: system is exactly singular in Mahalanobis distance
I am trying to run an Explanatory Factor Analysis on my questionnaire data.
I have data for 201 participants and 30 questions. The head of my data looks somehow like this (I am showing only the first ...
Score of 0
1 answer
1669 views
R Psych package: extract factor number from fa.parallel function
I conducted a parallel analysis with the Psych package in R.
I want to extract the number of factors from the output of fa.parallel() function, and save it to a variable for further processing. I ...
Score of 1
2 answers
1190 views
Extract full p-value from Lavaan CFA output in R
R-novice here. I am running a CFA using the Lavaan package. It is giving me everything I need, except my p-value is coming up at .000 and I would like to find the exact p-value (i.e. .0000009 or ...
Score of 1
0 answers
674 views
Error message lavaan cfa missing observed variables in dataset: ..constant
I am using lavaan package to run confirmatory analysis and got the following error:
Error in lavaan::lavaan(model = m7f, data = dat, std.lv = TRUE, model.type = "cfa", :
lavaan ERROR: ...
Score of 1
0 answers
40 views
How can I find easily which independent variable is in which factor in python?
I found the number of factors which is 8 in Python. But I couldn't get actually which independent variable is in which factor. It would be better to see from the table. Also I couldn't see the actual ...
Score of 0
1 answer
478 views
CFA in R with lavaan: different results for fit measures with command fitmeasures() than in summary
I'm calculating a confirmatory factor analysis with the following model:
library(lavaan)
CFA <- "
A =~ BK01_01_z+BK03_01_z+ BK03_03_z+ BK03_04_z+BK03_05_z+ BK03_07_z+ BK03_08_z+ BK05_01_z+...
Score of 0
1 answer
777 views
How to get error variance for each item in lavaan cfa?
I want to extract the error variance for each item (i.e. indicator) from a lavaan CFA.
library(lavaan)
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
...
Score of 1
0 answers
568 views
Error in R: 'system is exactly singular' when doing factor analysis
I am doing a factor analysis from ESS dataset. I have chosen 8 IVs and combined 3 countries to create a dataframe. (All NA values are substituted by median)
# "United Kingdom","Denmark&...
Score of 1
1 answer
708 views
psych FA biplot colour by group
I'm trying to use psych to perform factor analysis and create a biplot in which points are coloured by grouping variable.
I want the biplot to group by colour and only plot points not group labels.
...
Score of 1
1 answer
652 views
Is it necessary to fix covariance to zero when the variance of a factor is fixed at zero?
When I conducted sem using lavaan, I found the variance of a factor was negative. So I fixed the variance of this factor to be zero. Should I fix the covariance with this factor also to be zero? I ...
Score of 0
1 answer
393 views
How to set the `weight` argument in psych::principal function?
I am trying to run an exploratory analysis using PCA to determine the factorial structure of a scale.
The packages I am using are:
library(GPArotation) # required for `principal` to work
library(psych)...
Score of 1
0 answers
309 views
Hierarchical Factor Analysis in R using FactoMineR
I'm new to R - moved from SAS and I'm just not sure on the syntax.
I'm working on a dataset with one hundred patients examined at 4 different time points using eighty variables at each time point.
I'...
Score of 0
1 answer
1944 views
Having trouble with node name sizes for semPaths
So far, this is the code I have for my structural equation model:
#### Libraries ####
library(lavaan)
library(semPlot)
#### Cov Matrix ####
# Load
lower <- "
2.60
0.74 1.20
0.66 0.52 4.50
...
Score of 0
0 answers
431 views
Using fa.plot: how to label datapoints with variable names?
I've been consulting this site for a while but only now signed up. I have a very basic question about plotting factor analysis results using the fa.plot function, and I'm sure the answer is ...
Score of 2
1 answer
731 views
How can I create a parallel analysis scree in R?
Dataset Dput
structure(list(V1 = structure(c(4, 4, 2, 2, 2, 2, 2, 2, 4, 4,
2, 3, 2, 3, 4, 2, 2, 2, 3, 3, 2, 3, 1, 3, 3, 3, 3, 4, 1, 2, 4,
1, 2, 3, 2, 3, 1, 1, 2, 2, 4, 3, 2, 1, 2, 3, 3, 4, 3, 3, 2, ...
Score of 2
2 answers
986 views
How can I get the initial communalities for an exploratory factor analysis in R?
I would like to obtain the initial communalities for an exploratory factor analysis in R
(that is, the R squared of each item when predicted by the other items included in the analysis).
Is there a ...
Score of 3
1 answer
263 views
Difference between fit$loadings and fit$Vaccounted for variance accounted for in factor analysis?
I am getting different values for variance accounted for by factors in factor analysis whether I check them with fit$loadings or with fit$Vaccounted. I am using the psych package with the fa() ...
Score of 0
1 answer
259 views
runMI function error: 'no slot of name "internalList" for this object of class "lavaanList"'
I have run a multiple imputation (m=45, 10 iterations) using MICE and am attempting to fit a series of confirmatory factor analysis and structural equation models on the imputed datasets using the ...
Score of 0
1 answer
1662 views
Can I trust my cfa results if the variance-covariance matrix does not appear to be positive definite?
I am trying to create a structural equation model that tests the structure of latent variables underlying a big 5 dataset found on kaggle. More specifically, I would like to replicate a finding which ...
Score of 0
0 answers
122 views
Mclust and factorial data: R
I'm trying to do some clustering with R and I need some help:
The first step was a factorial analysis of percentage data and the results are 4 factors.
After that I would like to try some mixture ...
Score of 0
2 answers
804 views
Stuck using the multipleGroup and DIF functions in mirt package
Feeling stuck on this one and would love some advice. I think I'm getting lost on terms which is what's holding me back. In my code (below), I'm trying to run two DIF analyses, one on race and one on ...
Score of 0
0 answers
856 views
Understanding the output from a factor analysis using the FAMD function
I have some survey data where people were asked questions and given a yes or no option (1=yes, 0=no). I would like to be able to pick out some patterns in this data.
The questions are:
Do you enjoy ...
Score of 0
1 answer
906 views
Understanding Eigenvalues with factor_analyzer and Scree Plots in python
I've done a couple factor analyses now using the factor_analyzer python package. Everyone online seems to use nearly the exact same workflow :
fit the correlation matrix of your features without ...