StructuralEquationModels.jl icon indicating copy to clipboard operation
StructuralEquationModels.jl copied to clipboard

Explained variance (R2)

Open brandmaier opened this issue 3 months ago • 1 comments

Hi,

I created a function to compute explained variance ($R^2$) values for observed variables because I want to use this in our tutorial. This should just be a standard helper function in the package. What do you think?

Here is my PR: https://github.com/StructuralEquationModels/StructuralEquationModels.jl/pull/284

I checked the result against one exemplary model against the lavaan output and it was identical.

Best, Andreas

brandmaier avatar Nov 05 '25 13:11 brandmaier

At first, I called this pseudo $R^2$, which is not a good naming because this is usually used for $R^2$-type estimates in logistic models. I propose to just call the function explained_variance().

brandmaier avatar Nov 05 '25 19:11 brandmaier