Howdy, Stranger!

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

Supported by

JASP SEM module and weights

Hi, I'm trying to employ weights in the SEM module. I get an error message that says : "Error in Model 1 - Estimation failed. " The message goes on to say that the sampling weights variable "[gives variable name]" was not found and that the only variable found in the data frame are those that have been used in the SEM code (the variables making up the model). The sampling weights variable is in the data and I chose it from the dropdown menu for Sampling weights under JASP. Is there a fix I can use? TIA!

Comments

  • A screenshot and the model code would help!

  • The model is a single factor with 4 indicators, multiple group, and equal loadings across groups. I get the error message when I select the weight variable from the dropdown menu. The same happens for simpler models (one factor, one group). I have pasted the syntax and some screenshots below.

    jaspSem::SEM(

    version = "0.19.2",

    equalLoading = TRUE,

    group = list("<no choice>", "QCountry", "combo_weight1", "PA_connect", "PA_comfort", "PA_glad", "PA_livcond"),

    models = list(list(name = "Model 1", syntax = list(columns = list("JaspColumn_3_Encoded", "JaspColumn_2_Encoded", "JaspColumn_4_Encoded", "JaspColumn_5_Encoded"), model = "Factor =~ JaspColumn_2_Encoded+JaspColumn_3_Encoded+JaspColumn_4_Encoded+JaspColumn_5_Encoded", modelOriginal = "Factor =~ PA_connect+PA_comfort+PA_glad+PA_livcond"))),

    naAction = "listwise",

    samplingWeights = list("<no choice>", "QCountry", "combo_weight1", "PA_connect", "PA_comfort", "PA_glad", "PA_livcond"))

  • edited July 23

    edit: never mind that's not it, I'm using 19.3 and I'm also unable to make sampling weights work

    This is probably not it, but there used to be a bug in SEM analysis where if you added a variable in your dataset after the SEM analysis was first created, then variables were either read in the wrong order or not found (I see you're using 19.2, I don't recall what version this was fixed). If you've created the weight variable after creating the SEM analysis, it could be worth re-creating the SEM analysis and trying again (I think duplicating the analysis works too, but I'm not sure so it's safer to re-create the SEM analysis from scratch if you want to try it out)

  • Also, you might try getting rid of spaces and underscores in variable names...

Sign In or Register to comment.