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


                      • #12
                        Good afternoon, regarding the comment #2, I wannted to ask why it is not possible to include pweights into the xtreg, re command.
                        For our RnR, we were asked to include inverse probability weights into our panel random effects models and it is not working in stata. Alternatively, I am using mixed models, which allow me to include the inverse probability weights and at the same time keep the nested strucutre of the panel data. But I would like to know WHY we cannot include the pweight into the xtreg,re command to explain to the reviewers why we choose to implement the weights into the mixed models for our robustness check. Thank you very much in advance!

                        Comment


                        • #13
                          Originally posted by Marlene Waetzold View Post
                          But I would like to know WHY we cannot include the pweight into the xtreg,re command to explain to the reviewers why we choose to implement the weights into the mixed models for our robustness check.
                          You should distinguish between an estimator and a model. Here, -xtreg, re- and mixed are commands. The former does not allow probability weights, whereas the latter does. However, -xtreg, re- estimates a two-level random-intercept model, which can also be estimated using mixed. Therefore, one cannot justify excluding weights merely on the basis that -xtreg, re- does not permit them, because the same model can be estimated with weights using a different command.

                          However, the documentation includes an important note regarding the use of probability weights in multilevel models:

                          Code:
                          help mixed##sampling
                          Remarks on using sampling weights

                          Sampling weights are treated differently in multilevel models than they are in standard models such as OLS regression. In a multilevel model, observation-level weights are not indicative of overall inclusion. Instead, they indicate inclusion conditional on the corresponding cluster being included at the next highest-level of sampling.

                          For example, if you include only observation-level weights in a two-level model, mixed will assume sampling with equal probabilities at level two, and this may or may not be what you intended. If the sampling at level two is weighted, then including only level-one weights can lead to biased results even if weighting at level two has been incorporated into the level-one weight variable. For example, it is a common practice to multiply conditional weights from multiple levels into one overall weight. By contrast, weighted multilevel analysis requires the component weights from each level of sampling.

                          Even if you specify sampling weights at all model levels, the scale of sampling weights at lower levels can affect your estimated parameters in a multilevel model. That is, not only do the relative sizes of the weights at lower levels matter, the scale of these weights matters also. To deal with this, mixed has the pwscale() option for rescaling weights in two-level models; see above for more information on pwscale(). Three scaling methods are offered, with each method known to perform well under certain data situations and posited models.

                          In general, exercise caution when using sampling weights with mixed; see Survey data in [ME] mixed for more information.
                          Assuming you are aware of these issues, there should be no problem using probability weights in the model that would otherwise be estimated with -xtreg, re-, provided that you instead estimate it using mixed.

                          Comment


                          • #14
                            Marlene is using xtreg to estimate a model with panel data. I didn't know that "xtreg, re" disallowed weights. I think it should, as it does with "xtreg, fe," provided the weights don't change across time. (Time-varying weights introduce real complications.) I suspect the problem is that Stata isn't sure what to do with a two-step feasible GLS estimator. It should be find to use the weights in pooled OLS, use the weights to estimate the T x T variance-covariance matrix, and then apply the inverse probability weights to the FGLS formula.

                            The "mixed" commands are implemented using maximum likelihood, so there is no two-step estimation. There, it is clear that one can simply weight the log-likelihood function for unit i (in a panel data case) by 1/p_i. In fact, I considered this case in my 1999 Econometric paper on weighted M-estimation. So if you use "xtmixed" it will be essentially the same as "xtreg, mle." Fortunately the MLE is fully robust to nonnormality, and using the pweights option with xtmixed automatically generates fully robust standard errors.

                            So the explanation is that, rather than two-step feasible GLS, you're using quasi-MLE under normality, implementing pweights, and reporting fully robust standard errors.

                            Comment

                            Working...
                            X