Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Error when using a variance-covariance matrix as input for lavaan/SEM module

Has anyone out there successfully run a SEM model in JASP using a variance-covariance matrix as input?

The raw data input seems to work fine, but when I try using a covariance matrix input, I keep getting an error that lavaan crashed:

"Error in lav_samplestats_from_moments(sample.cov = sample.cov, sample.mean = sample.mean, : lavaan ERROR: rownames of covariance matrix do not match the model! found: 1 2 3 4 5 6 expected: VAR1 VAR2 VAR3 VAR4 VAR5 VAR6."

VAR1-6 are my variable names, which are listed in the top row of a .csv file (attached). Does the file need to be formatted a different way for the variable labels to apply to the matrix rows in lavaan? When I also include the labels vertically in the first column of the datafile, it tells me that "Dataset is not a proper variance-covariance matrix.".

Everything seems to work fine until running the model syntax. Has this worked for anyone, or could it be a bug in the JASP implementation of lavaan's covariance input?




  • Hi Ben,

    I'll forward this to our SEM team member (who is on vacation right now). Thanks for reporting this.



Sign In or Register to comment.