Announcement

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

  • Probability weights in random effects models

    Hello,

    I am trying to estimate the effects of several time invariant variables on my outcome using random effects and xtreg. I am using panel data and I need to incorporate probability weights. I am aware that xtreg does not allow for pweights or aweights, so I am not sure what my options are at the moment?

    The error message I get is

    weights not allowed
    r(101);

    which makes sense, so then would I have to abandon the weights?

  • #2
    Isaac:
    you can use -iweight- in the -re- specification only if you switch from -xtreg,re- to -xtreg, re mle- (that can also be coded as -xtreg,mle- as -re- is actually redundant).
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you, Carlo.

      I can run my regression using iweight and xtreg,mle without getting an error message. The results also make a whole lot more sense now.

      Comment


      • #4
        Hi Carlo,

        I am running an xtlogit and like Hale, I am only allowed to use iweights. I checked to see how the results differ between the weighted and unweighted models. The coefficients are practically identical, except for a few instances where numbers were rounded. The difference was in the z-statistics and the standard errors. In the iweighted model, the test statistics were much larger and the standard error were much smaller.

        Could you please let me know why I am seeing these results? I am also unclear as to what the iweight does in the equation. I know that the help section in the program cautions against using them, but I cannot find information as to why that is. I worry that my analysis may not be statistically sound if I use them, but I have to use weights.

        Any insights on this would be very helpful and much appreciated!

        Comment


        • #5
          Elena:
          as per FAQ, pplease share what you tyoed and what Stata gave you back. Thanks.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Stata's mixed model suite, i.e. the ME series will accept the svy prefix, meaning it accepts weights.


            Richard T. Campbell
            Emeritus Professor of Biostatistics and Sociology
            University of Illinois at Chicago

            Comment


            • #7
              Hi Carlo,

              The real models I am running are in a secure lab and I can't actually show you what the results are until they are approved by a governing body. This is why I must use weights, it is their policy. This dataset is open data, so I have been practicing on it at home to see what options I have before returning to the lab and running the code on my actual data.

              Stata will not let me use any of the following below:

              Code:
              xtlogit hassa i.prov i.agegp i.sex [aw=fweight]
              aweights not allowed
              r(101);
              Code:
              xtlogit hassa i.prov i.agegp i.sex [fw=fweight]
              may not use noninteger frequency weights
              Code:
              gen weight=round(fweight, 1)
              
              . xtlogit hassa i.prov i.agegp i.sex [fw=weight]
              fweight not allowed for fixed- and random-effects cases
              Code:
              xtlogit hassa i.prov i.agegp i.sex [pw=fweight]
              pweight not allowed for fixed- and random-effects cases
              Hassa is a binary variable indicating whether someone is on social assistance 1=yes/0=no; prov is a variable indicating the person's province of residence; agegp is their age group; and sex id male=1/female=2

              Unfortunately, I have been trying to re-run the xtlogit models like I did yesterday, which worked, and I got results that were identical between coefficients, but inflated z-scores and smaller confidence intervals (same as what I observed at the lab). Now, I am getting an error (maybe I did something to this data, I am not sure?):

              Code:
              . xtlogit hassa i.prov i.agegp i.sex [iw=fweight]
              weight must be constant within personid
              r(199);
              I guess my question is more regarding what iweights are...I can't find anything online that gives me a definitive answer. Most documentation states that iweights are for programmers, but then why is it the only way to weight the xtlogit with the iweight option. I worry that my results may not be statistically sound and I do not want to use iweights if I do not know what they are doing...Any help on this would be appreciated!

              Comment


              • #8
                Originally posted by Dick Campbell View Post
                Stata's mixed model suite, i.e. the ME series will accept the svy prefix, meaning it accepts weights.

                Yes, but can I use the svy prefix with an xtlogit? If my data has already been xtset or tsset, It can't be svyset too, correct?

                Comment


                • #9
                  Also, I got these errors:

                  Code:
                  svy:xtlogit hassa i.prov i.agegp i.sex [fweight=fweight]
                  weights not allowed with the svy prefix;
                  the svy prefix assumes survey weights were already specified using svyset
                  r(101);
                  Code:
                  svy:xtlogit hassa i.prov i.agegp i.sex
                  xtlogit is not supported by svy with vce(linearized); see help svy estimation for a list of Stata estimation
                  commands that are supported by svy
                  r(322);

                  Comment


                  • #10
                    Elena: I believe Dick's point is that if you switch to -melogit- then you can use the svy command. You can use -melogit- to estimate a random effects panel logit. And using -svy- should ensure that the standard errors are properly computed.

                    Comment


                    • #11
                      Oh, I see what is meant now. Thanks, Jeff!

                      Comment

                      Working...
                      X