Announcement

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

  • Rifhdreg with survey data

    Dear,

    I want to estimate a recentered influence function with the median as distributional statistic of interest. I use the command 'rifhdreg' as explained by Rios-Avila (2019).
    My data are survey data, so I use the option 'svy'. However, when I use this option, the option 'retain(new_var)' does not work (i.e. there is no new variable created), while if I don't use the option svy, the retain option does create a new variable. Both commands run fine and produce credible output; the difference is just that there is no new variable created when I specify the svy option.

    My code looks like:
    Code:
    rifhdreg log_wage_hourly    $education $experience $sector $occupation $context        if rural==1 & female==0,    rif(q(50)) retain(rif_r_m) svy
    Code:
    rifhdreg log_wage_hourly    $education $experience $sector $occupation $context        if rural==1 & female==0,    rif(q(50)) retain(rif_r_m)
    Is this some kind of bug or do I do something wrong? Or is there another way to retain the RIF from this regression?
    Thanks in advance for your help!

    Kind regards,
    Goedele Van den Broeck

    Attached Files

  • #2
    Hi Goedele
    Thank you for reporting the bug!
    I think I will correct that for the next update to the program.
    On the other hand. the RIF created by "retain" is not a function of the survey design, just the weights. So the best way to create the appropriate ones would be:
    Code:
     
     rifhdreg log_wage_hourly    $education $experience $sector $occupation $context        if rural==1 & female==0 [w=weight],    rif(q(50)) retain(rif_r_m)
    This code should replicate the same point estimates as the one using "svy".
    Fernando

    Comment


    • #3
      Dear Fernando,
      Many thanks for your quick reply! Your suggestion solved my problem.
      ​​​​​​​Goedele

      Comment


      • #4
        Dear Goedele and Fernando,
        thanks, that helped me out, during my work with rifhdreg on the HFCS data of the ECB.
        Might be a trivial question, sorry in advance for that, but:

        What das the $-sign mean and how can i interpret the output with or without the $-sign before the independent variables?

        Thanks and Best
        Henrik

        Comment


        • #5
          Hi Henrik,
          Whenever you see "$" in Stata code, I would say that 99% of the time means that there is a global macro associated with that "word"
          For example:
          Code:
          Say I do this before I start doing regression analysis
          global yvar logwages
          global xvar age education gender
          
          Now, for the regression (say simple OLS) I could type the following:
          
          reg logwages age education gender
          
          But i could just as well type:
          
          reg $yvar age education gender
          reg logwages $xvar
          reg $yvar $xvar
          
          In all cases, you would be producing the same output.
          The reason for this is that Stata "interpreter" substitute the global "yvar" or "xvar"
          with whatever you defined previously. 
          
          And it knows is something it needs to be substituted, because you use the "$" sign before that word
          Best regards
          Fernando

          Comment


          • #6
            Hi Fernando,
            thanks a lot, that makes it clear.

            Furthermore a few questions, whose answer would help me a lot.

            I am using the rifhdreg for a wealth survey dataset of the ECB and would like to decompose the Gini-coefficient (and in a next step maybe also take e.g. p(50) as an option) to find out what the drivers of inequality are. Is this the right approach?:
            Code:
            rifhdreg *Target variable* var1 var2 var3 if country==1 [w=weights], rif(gini) robust
            Can the coefficients be interpreted as easily as in standard OLS?
            Is it a problem if var1 var2 and var3 could be correlated to each other?

            First struggled with descogini but it doesn't allow weights, whereby it would be great to manage this with rifhdreg.

            Thanks and Best,
            Henrik

            Comment


            • #7
              FernandoRios thanks in advance, a quick answer would be great and a big step for me in publishing my master thesis

              Comment


              • #8
                Hi Henrik

                A word of advice. There is some literature that suggests that RIFregressions could be used to determine causes of "current" inequality. In my opinion, that is not correct.
                What RIFREG does is to allow you to think about what would happen with current inequality if the underlying distribution changes (slightly).
                For example if you do:
                Code:
                rifhdreg wage age education female, rif(gini)
                what you can say with the coefficients is:
                what would happen with inequality as the population ages [beta age] (everybody gets older in average in 1 year) , or if education attainment increases [beta [education] ] or if the share of women in the labor market changes (Beta{female) * a change in proportion of women in the market).

                You can also use this to say, how different is wage inquality when comparing men and women's distribution (kind of a distributional treatment effect)

                Code:
                rifhdreg wage age education female, rif(gini) over(female)
                See the public version of my paper (Rif regressions and rif decompositions) for an example.

                Best regards
                Fernando

                Comment


                • #9
                  Hello,

                  Is it possible to use subpop within the svy command in rifhdreg? Or should I just be specified with an "if" statement?

                  Thank you!
                  Ben

                  Comment


                  • #10
                    Currently
                    that option isn’t available
                    I ll try add it in a future update

                    Comment


                    • #11
                      Currently
                      that option isn’t available
                      I ll try add it in a future update

                      Comment


                      • #12
                        Thank you, Fernando!

                        Comment


                        • #13
                          FernandoRios, Andrew Musau, Statalist users,


                          I'm running the rifhdreg command on Stata/SE18. I'd like the first stage output, so I add "first" to the code as follows:

                          Code:
                          bootstrap, cluster(Clustvar): rifhdreg Depvar  x1  x2  x3  …  xN   i.Treatvar , rif(mean) over(Treatvar) rwlogit ( z1  z2  z3  …  zN ) ate iseed(0.50) first
                          However, the result that I get does not include the first stage output.


                          Question 1: What adjustment, if any, do I need to obtain the first stage output?

                          Question 2: I'd also like to run the command with a nominal (binary) dependent variable. What adjustments, if any, do I need to make?


                          Thank you.
                          Last edited by Odongo Kodongo; 23 Nov 2023, 01:31.

                          Comment


                          • #14
                            Originally posted by Odongo Kodongo View Post


                            I'm running the rifhdreg command on Stata/SE18. I'd like the first stage output, so I add "first" to the code as follows:

                            Code:
                            bootstrap, cluster(Clustvar): rifhdreg Depvar x1 x2 x3 … xN  i.Treatvar , rif(mean) over(Treatvar) rwlogit ( z1 z2 z3 … zN ) ate iseed(0.50) first
                            However, the result that I get does not include the first stage output.
                            I am not familiar with this command. FernandoRios, the author, is the right person to advise you.

                            Comment


                            • #15
                              Originally posted by Andrew Musau View Post

                              I am not familiar with this command. FernandoRios, the author, is the right person to advise you.
                              Many thanks, Andrew.

                              Comment

                              Working...
                              X