Announcement

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

  • Error "pweights must be positive" when running -mixed- command

    I'm going to keep this post as short as possible in the hope of obtaining a response. This precise topic was asked twice previously, both posts got no responses (see links below).

    I'm running a conventional -mixed- command with sampling weights and getting an uninformative error:

    > mixed log_wage [pweight=wgt] || industry: , pweight(other_wgt) variance male vce(robust)

    Gives the error "pweights must be positive." A -summarize- command shows no negative weights.

    Since my problem is identical to the linked posts, I'm keeping my question short.

    Post from 2016

    Post from 2014

    Does anyone have advice on this situation? Thank you very much!

  • #2
    I don't know if this will do it, but you can run the same model with svy: meglm. . First svyset the data with the two levels of weights; see Example 6 in the meglm manual entry. By the way, shouldn't "male" appear before the comma?
    Last edited by Steve Samuels; 03 May 2018, 17:57.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Thanks very much for your help Steve, I appreciate it.

      I added an svyset statement and implemented the svy: meglm command but it appears unable to converge, even when I specify the maximize_option "difficult." The -mixed- command is not supported with svy_estimation in the available version of Stata (14). It appears I remain stuck. Do you have any other thoughts?

      Finally, the "male" after the comma was an autocorrect from "mle" which I didn't notice. (Its correct in my .do file; the autocorrect is aggressive in the browser but blissfully absent from text editors.)

      Thank you very much again.

      Comment


      • #4
        There are other options besides difficult.
        However, I would speculate that at least part of the problem lies in a model that is too simple. Were there no covariates? I also have a hard time conceptualizing "industry" as a random unit. So I'd like to know more:

        * Please describe the sample design in detail (strata, primary sampling units, later stage units.). Show us the results of svydes. What is the unit for the last stage, the one on which wage is measured? Is "industry" one of the sampling stages? How many industries are there?

        • What is the study question your model is supposed to answer?

        When you show code, results, or data listings, please copy and paste from your do file or Stata log into the forum editor between CODE delimiters, described in FAQ 12.
        Last edited by Steve Samuels; 05 May 2018, 13:20.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment


        • #5
          Hello Edonavot,

          Did you ever get an answer and/or figure out how to execute mixed with weights? I am having the same issue. Thanks!

          Comment

          Working...
          X