Solved – Formula to compute factor scores (used for CFA in lavaan, to be applied in Excel)

confirmatory-factorexcelr

I'm asked by my client to recreate cfa model in excel;
with all the formulas in the cells.

I used lavaan and R to fit the model. It's a simple step to get factor scores in lavaan using predict(fit). Can it be recreated in excel?

Input: (1) excel columns with indicator variables; (2) cfa model estimates and covariances from lavaan output

Desired output: excel column with factor score, using Excel formulas

Best Answer

Since the factor scores are a linear function of the observables, once you've calculated them once, you can simply use lm to fit a linear regression between the fitted scores and the observables. The regression will give your an $R^2$ of $1$ and you can just read off the linear coefficients. You can then recreate the scores directly from the observations in excel or elsewhere.

You only need the horribly complicated linear algebra to calculate them the first time - so as long as you are not refitting the model in excel, you can just use the linear form directly.

Related Question