Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

Question list filters

Filter by
Sorted by
Tagged with
Filter by Employee ID
Score of 0
0 answers
52 views

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 ...

1
2 3 4 5