1. Tania

    Thank you for this, it is very useful. However, I am getting the following error when fitting the weighted model:
    „lavaan::duplicationMatrix‘ is deprecated.
    Use ‚lav_matrix_duplication‘ instead.“
    Do you know how to tackle this?

    • Niels

      Hi Tania,
      you don´t have to worry about this warning-message. There was a lavaan-update that changed the name of some functions and Daniel Oberski hasn´t adapted his lavaan.survey-package, yet. I asked him once on twitter and he told me, that it doesn´t affect your analysis. Just ignore the message, i´m sure it will be gone with the next update of the lavaan.survey-package. Best wishes, Niels

  2. Tania

    Hi Niels,
    I have another issue, and I thought maybe you could help me. I ran my model not using weights and I got very good fit and significant coefficients which made a lot of theoretical sense. Then, I ran my model using weights and the results changed completely (horrible fit, many coefficients not significant). I cannot understand why I have these many changes, any idea? Is lavaan.survey only intended for some type of weights? could it be that my weights are not suitable or appropriate? I am grateful for any suggestions or ideas! Thanks!

  3. Niels

    Hi Tania,
    i´m afraid without more information about your data and your weighting-variable (like strata or sth else), it´s hard to guess where it goes wrong. My first idea would be, that you have missing values. The unweighted analysis used FIML and in the weighted analysis FIML is not (!) available, so lavaan.survey used listwise deletion instead. This information loss can lead to very different data. Is N different between both models? My second idea would be, that you haven´t created your svydesign-object adequately for your data. Perhaps you should visit the lavaan google-group and post your problem there. I´ll have a look on it, too. ==> https://groups.google.com/forum/#!forum/lavaan

  4. Tania

    Thank you Niels. The weights I am using, which were not calculated by me, but from the Agency that developed the survey, are calculated in four stages: selection of county, selection of area, selection of home and selection of subject. I don’t think that the problem are missing cases since I ran the non weighted model with the same cases as in the weighted model (since I only have a 6% of missing data I decided not to impute data). I think that the second option could be the case, where I did not specify the weight correctly. I copy it here in case you see anything wrong:

    survey.fit17d <- lavaan.survey(model17d.fit,
    estimator = "MLM")

    Is there something else I should specify? I should mention that my exogenous variables are nominal and ordinal, and all my exogenous variables are continuous but non-normal (reason for which I used MLM). I will post my problem also at the lavaan group.

    Thank you very much!!

  5. Niels

    It seems, you only apply individual weights and omit the strata (stages) right now. The data should contain at least one variable for the strata, so you can define in it with „strata=variable“ in the svydesign-call. Perhaps, you´ll finde some answers for your special case here:
    http://faculty.washington.edu/tlumley/old-survey/index.html and

    Or try the r-help mailing-list: https://stat.ethz.ch/mailman/listinfo/r-help
    Best wishes

  6. Niels

    For anybody reading this, who has a similar problem: It turned out, the weight could be specified correctly with the „probs“-argument in the survey-call.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.