I am trying to get a single factor from two variables (measured on 5-point Likert scale) using Confirmatory Factor Analysis (CFA). I understand that the degree of freedom for a model with 1 factor and 2 loads is -1 , and hence the model is under-specified. But, I have seen models where two variables are used as loadings for a single underlying factor.
I tried to run CFA in Python using sklearn, but it returned negative factor loadings for both loads, which I think is incorrect.
Python code (with data):
import sklearn.decomposition as skd
x = [[2., 4.], [1., 2.], [1., 1.], [2., 2.], [2., 2.], [2., 1.], [1., 1.], [2., 2.], [3., 2.], [2., 2.], [1., 2.], [1., 1.], [2., 2.], [2., 2.], [1., 1.], [3., 3.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [0., 0.], [2., 2.], [2., 2.], [2., 2.], [2., 2.], [2., 2.], [1., 1.], [2., 2.], [2., 2.], [2., 2.], [2., 2.], [2., 2.], [2., 2.], [1., 1.], [2., 2.], [2., 2.], [1., 1.], [2., 2.], [2., 1.], [2., 2.], [3., 2.], [1., 1.], [1., 1.], [1., 1.], [2., 2.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [2., 2.], [1., 1.], [2., 4.], [2., 2.], [1., 1.], [2., 2.], [2., 2.], [3., 2.], [3., 2.], [1., 1.], [1., 1.], [2., 2.], [1., 1.], [1., 1.], [1., 2.], [1., 1.], [1., 1.], [2., 2.], [3., 3.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [2., 3.], [3., 3.], [2., 2.], [2., 2.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [2., 2.], [1., 1.], [2., 2.], [1., 1.], [3., 3.], [2., 2.], [2., 2.], [2., 2.], [2., 2.], [1., 1.], [1., 1.], [2., 2.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [2., 2.], [2., 2.], [2., 2.], [1., 1.], [1., 2.], [2., 2.], [2., 2.], [2., 2.], [2., 2.], [2., 1.], [2., 2.], [1., 1.], [1., 1.], [2., 2.], [1., 1.], [1., 1.], [1., 1.], [1., 1.], [2., 2.], [2., 2.], [1., 2.], [1., 1.], [1., 1.], [2., 2.]]
skd.FactorAnalysis(n_components=1).fit(x).components_[0]
Output:
array([-0.55779804, -0.58890195])
I also tried to run CFA in R using 'lavaan' library, it is returning me the following error:
Warning message in lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats, : "lavaan WARNING: Could not compute standard errors! The information matrix could not be inverted. This may be a symptom that the model is not identified."
I am new to CFA and Structural Equation Modeling (SEM), and would really appreciate if anyone can explain me my error (or should I say blunder!).