Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error "pweights must be positive" when Including sampling weights in multilevel longitudinal mixed linear model

    Hi Stataists,

    We am trying to include sampling weights in my longitudinal multilevel three-level mixed models with 'pweight' command, but was told with an arising error 'pweights' must be positive. my code is listed ads follows:

    mixed RKESS001 || familyid:, reml covariance(unstructured) || parentid:, pw(GOVWT2), covariance(unstructured),


    the error is coming up as below:
    . mixed RKESS001 || familyid:, reml covariance(unstructured) || parentid:, pw(GOVWT2) covariance(unstructured),
    note: single-variable random-effects specification in familyid equation; covariance structure set to identity.
    pweights must be positive
    r(111);

    As suggested by some posts on the similar issues within the forum https://www.statalist.org/forums/for...st-be-positive, some cases with negative or zero would be reduced or deleted. In our case cannot tolerate reducing cases of data as we are computing grwoth models. So we try to figure out this issue by transferring to using 'svyset' command with 'meglm' rather than 'mixed', but still failed to fix it. See below.

    svyset parentid [pweight=GOVWT2]

    svy:meglm RKESS001 || familyid:, reml covariance(unstructured) || parentid: covariance(unstructured),

    but still coming with some errors as below:

    . svy:meglm RKESS001 || familyid:, reml covariance(unstructured) || parentid:, covariance(unstructured),
    negative weights encountered
    r(402);

    I am not sure whether the code listed above is correct in the Stata computing environment. But hope any of you could help check my codes and help with this condition especially if you have come across or been familiar with this issue and know how to fix it. Would appreciate any from you all. Thank you!

    Best wishes,

    Wenyuan

    Last edited by Wenyuan Liu; 14 Jan 2022, 07:17.
Working...
X