Extracting shared variance as scores from CFA in Lavaan

I’m trying to figure out how to get the common variance from three variables in my dataset. I think I could use a Confirmatory Factor Analysis (CFA) and set the loadings to be the same. Then I want to get the measurement error as scores for each item and every data point. Kind of like how you can get factor scores for each observation.

I’ve been looking around but can’t seem to find any examples or code that shows how to do this. It doesn’t seem to be a common thing people do.

Does anyone have experience with this or know how to go about it in Lavaan? I’d really appreciate any tips or advice on how to approach this problem. Thanks!

Hey SurfingWave! That’s an interesting problem you’re working on. :thinking:

I’m curious about why you want to extract the shared variance as scores specifically. Is this for a particular research question or methodology you’re exploring?

While I don’t have direct experience with this exact approach in Lavaan, I wonder if you could adapt some techniques from factor score estimation? Maybe something like:

  1. Run your CFA with equal loadings
  2. Extract factor scores
  3. Calculate residuals (observed - predicted)
  4. Use those residuals as your measurement error scores

Just brainstorming here! What do you think about that approach?

Have you considered reaching out to the Lavaan mailing list? The community there is super helpful and might have some creative solutions.

I’d love to hear more about your project and what led you to want to extract shared variance this way. It sounds like you’re working on something pretty unique!

I’ve encountered a similar challenge in my work with structural equation modeling. While extracting shared variance as scores isn’t a common approach, it’s an intriguing idea.

Have you considered using the lavPredict() function in Lavaan? It allows you to obtain factor scores after fitting your CFA model. You could then potentially calculate the residuals by subtracting these predicted scores from your observed variables.

For the measurement error scores, you might look into the standardized residuals. These could potentially serve as a proxy for what you’re seeking.

Keep in mind that this approach may have some limitations in terms of interpretability and statistical properties. It might be worth consulting with a methodologist to ensure the validity of this method for your specific research questions.

If you decide to pursue this, I’d be very interested to hear about your results and how you ultimately implement it. Good luck with your analysis!

hey surfingwave, interesting idea! have u tried using lavPredict() to get factor scores after ur CFA? then maybe subtract those from observed vars for measurement error? Not sure if itll work exactly, but worth a shot. let us know how it goes!