Announcement

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

  • RIF- Regression Unconditional Quantile Regression (Counterfactual Decomposition)

    Dear STATA Seniors and Pros,

    I seek your guidance in regard to a few confusions that I am currently facing in analyzing my Master's Thesis-work in STATA. Your valuable guidance would be a significant contribution in my Thesis work.

    I would begin with describing the context of my problem, and would later outline my specific problems.

    CONTEXT

    I am currently working on my Master's Thesis entitled "Explaining Cross-Province Differentials in Child Nutritional Outcome in Nepal: An Application of Quantile Regression-Counterfactual Decomposition". I am working on the Demographic Health Dataset 2016.

    The specific research questions that my Thesis strives to answer are the following:

    i. Are cross-province differentials in Child Nutritional Outcome (in Nepal) explained by difference in Endowments? [covariate effect]
    a. Which specific endowment most explains the differential?
    ii. Are cross-province differentials in Child Nutritional Outcome (in Nepal) explained by difference in Returns to Endowments? [coefficient effect]
    a. The return to which specific endowment(s) most explains the differential?

    I would be conducting pair-wise comparison of Provinces in Nepal. (There are total 7 provinces, 1 of the Provinces with lowest prevalence of child stunting will be selected as a reference group; and the other six would be compared with the reference Province). The pair-wise comparison follows the Analytical method followed by (Cavatorta, Elisa; Shankar, Bhavni; Flores-Martinez, Artemisa, 2015) in their study of "Explaining Cross-State Disparities in Child Nutrition in Rural India". However, I depart from the decomposition method (Machado and Mata, 2005) that they have used for the reason mentioned below.

    After careful consideration of various approaches of decomposition methods, I found that two approaches have been mostly used in the previous literature to answer similar research questions: Machado and Mata (2005)'s method of simulating counterfactual distribution and subsequent decomposition, and Firpo. et. al. (2018) Unconditional RIF Quantile Regression method.

    Since Machado and Mata (2005) decomposition does not allow detailed decompsition, and I am interested in detailed decomposition of covariate and coefficient effect, I have further found that Firpo. et. al. (2018) most suits my research question. The method has also been used in a previous study by (Srinivasan, Chittur S.; Zanello, Giacomo; Shankar, Bhavani, 2013) in explaining the Rural-urban disparities in child nutrition in Bangladesh and Nepal with similar research questions as mine.


    PROBLEM

    I have been trying to educating myself on running first-and-second estimation stages of RIF-Regression, and have been trying to grasp a number of STATA commands (rifreg, oaxaca8, oaxaca_rif, dfl) in that regard.

    However, I am facing a number of confusions, and hence, I seek your guidance in regard to the following questions. I would be extremely grateful if you could please guide me through this.

    1. First and Second Stage Estimation

    In the previous study (Srinivasan, Chittur S.; Zanello, Giacomo; Shankar, Bhavani, 2013), the authors have used Kernel Smoothing techniques and Kernel estimation methods to form a counterfactual distribution. However, I am finding it extremely confusing in regard to how should I proceed that with rifreg command.

    - Should I first estimate counterfactual distribution using Kernel estimation methods, and then use that estimate as 'rifvar' in rifreg command? If yes, how would you recommend me to proceed with the Kernel estimation method?

    - I also tried using "dfl" command developed by Joao Pedro Azevedo (2005) that estimates DiNardo, Fortin and Lemieux (DFL) Counterfacual Kernel Densities.
    Firpo et. al. (2009) have indicated that kernel density estimation of counterfactual could follow the DFL method. However, I am a bit confused on how can I get "dfl" to compute kernel estimates [and not the logit estimate]. I am also confused if "adaptive kernel estimate" means the usual kernel estimate that I am looking for.


    2. Model selection

    Firpo et. al. (2009) as well as the previous study (Srinivasan, Chittur S.; Zanello, Giacomo; Shankar, Bhavani, 2013) suggest that the model selection involves minimizing the differences between the counterfactual distribution and the empirical distribution (of the group, whose covariate distribution has been used in the estimation of counterfactual distribution).
    I am a bit confused how will I be best able to test for these differences (between counterfactual and empirical distribution) in STATA.
    I suppose there are some statistical tests in using kernel density estimation, but I'm a bit unfamiliar of the command in STATA.


    3. Demographic Health Survey Design

    I tried searching for some earlier posts on how could we possibly account for two-level complex survey design while using rifreg. Bootstrapping was mostly suggested. However, I am a bit confused on how to use bootstrapping.
    -Should I use bootstrapping in both first and second stages of RIF-regression?
    -How can I possibly determine what value of bootstrap reps should I choose?

    4. Percentage values of the contribution of covariate and coefficient

    I intend to present my results in a table with relative percentage contribution of each covariate and coefficient effects, the same way as (Srinivasan, Chittur S.; Zanello, Giacomo; Shankar, Bhavani, 2013) have presented their results on Page 11 of their report. I would be grateful if you could please guide me on how could I achieve that.


    I would be grateful for your valuable guidance.

    Thank you.

    Gopal Trital
    Erasmus Mundus Master's Scholar in International Development Studies

    References

    Cavatorta, Elisa, Shankar, Bhavni, and Flores-Martinez, Artemisa, ‘Explaining Cross-State Disparities in Child Nutrition in Rural India’, World Development, 76 (2015), 216–37.

    Firpo, Sergio, Fortin, Nicole M., and Lemieux, Thomas, ‘Unconditional Quantile Regressions’, Econometrica, 77/3 (2009), 953–73

    Firpo, Sergio, Fortin, Nicole, and Lemieux, Thomas, ‘Decomposing Wage Distributions Using Recentered Influence Function Regressions’, Econometrics, 6/2 (2018), p.12-13.

    Joao Pedro Azevedo, 2005. "DFL: Stata module to estimate DiNardo, Fortin and Lemieux Counterfactual Kernel Density," Statistical Software Components S449001, Boston College Department of Economics, revised 21 Dec 2010.

    Machado, José A. F., and Mata, José, ‘Counterfactual decomposition of changes in wage distributions using quantile regression’, J. Appl. Econ., 20/4 (2005), p. 445–65.

    Ministry of Health, Nepal; New ERA; and ICF. 2017. Nepal Demographic and Health Survey 2016. Kathmandu, Nepal: Ministry of Health, Nepal.

    Srinivasan, Chittur S., Zanello, Giacomo, and Shankar, Bhavani, ‘Rural-urban disparities in child nutrition in Bangladesh and Nepal’, BMC public health, 13 (2013), 581.


  • #2
    Dear Gopal
    Here are some pointers regarding your questions:
    First of all i would recommend you to read FFL (2018) paper thoroughly, as it provides all the answers for the questions you have.

    1. First and Second Stage Estimation

    Based on their description, Srinivasan et al (2013) do not actually use Kernel estimations to obtain conterfactual distributions. Instead they use a reweighted procedure to obtain this counterfactual distribution.
    I find it easier to consider the model as a three stage process.
    1st. Estimate a probit or logit model to obtain the Inverse probability weights, use them to identify counterfactual distribution for reference groups. This is a parametric approach to do what DFL do in their paper, but is less involved. You can add a large set of characteristics on this step to improve the results from the reweighting procedure. Think of it as allowing for nonlinear effects in a propensity score matching set up.

    2nd. Estimate three RIF regressions. two using the original data and the "RIF" of interest, say 50th quantile. plus a third regression using the estimated weights to identify counterfactual distribution.

    3rd. Implement the OB decomposition as described in Firpo, Fortin and Lemieux (2018)

    The DFL command can also be used to identify the IPW weights. Instead of using a simple logit /probit regression, it uses the more involved method described in DiNardo et al 1996 (http://www.uh.edu/~adkugler/DiNardoetal.pdf) but for your purposes, using the standard method should sufice, unless you receive other recommendations from your advisor.

    The program "oaxaca_rif", you can specify what variables are to be included in the first step (estimation of the Inverse probability weights) selecting to estimate a probit or logit model. You can include there the same variables as in the outcome model, plus interactions or higher order polynomials.
    The second step is automatically done within the oaxaca_rif procedure, and all the decomposition components described in FFL(2018) are reported as part of the output (third step).

    2. Model selection

    This model selection simply means that when specifying your probit or logit model to obtain the reweighting weights, you need to double check so that the distribution of the observed characteristics after using the weights are balanced across groups. (just as you point out).

    Based on FFL(2018), the easiest way to do this is to analyze the reweighted error component from the oaxaca_rif output. the detailed decomposition can be used to test if the distribution of all characteristics are balanced. Alternatively, you can look for the community contributed program "psmatch2" and "pstest". The last one allows you to test how well balance the characteristics between two groups. You can use the IPW weights you obtain from the logit / probit step to do this.

    3. Demographic Health Survey Design

    When using RIF regressions, the recommendation is to use Bootstrapping. However, accounting for survey design and bootstrapping is tricky, depending on the complexity of it. On this point, i would askyour advisor how important will be to use or ignore the survey design.
    Accounting for cluster for Bootstrapping is easy. (just include the cluster information when doing bootstrap), but accouting for weights require a estimating Bootstrap survey weights.
    In any case, yes, the appropriate way to do bootstrapping with RIF regressions is to do that for the WHOLE process. Ignoring survey design, if you add the "bootstrap" prefix in front of the oaxaca_rif command should suffice. Regarding to how many repetitions, that is an open question. For exploratory analysis (just to see results), use the standard 50 repetitions. For your final reported tables, increase it to a large number. Say 500.


    4. Percentage values of the contribution of covariate and coefficient

    This are straight forward. For example, to see the contribution of age to the composition effect, you just divide the detailed age contribution by the overall composition distribution.

    HTH
    Fernando

    Comment


    • #3
      Thank you so much Sir.

      I really appreciate your detail reply. I shall surely go back to the literature as you have suggested.

      I'm beyond my words to express how glad I'm to have this reply.

      Thank you again.

      Comment


      • #4
        Dear @Fernando,

        I want to get some help about my two confusions about using the command "oaxaca_rif".

        First, afetr installing command "oaxaca_rif", I want to repeat some syntaxes from the help window, especially those starting with"oaxaca_rif", such as " oaxaca_rif lnwage educ exper tenure, by(female) wgt(1) rif(mean)". But there are something wrong with the code running, where displaying "option robust not allowed; r(198)". I'm really astonished about this error because there is no codes about robust in the running syntax.
        Thereafter, I have tried replacing initial "oaxaca_rif.ado" command with the new version ("version 2.32 Feb 2020 Fernando Rios Avila"), and also use the installing code (net sj 20-1;net install st0588;net get st0588) from your paper(2020, stata journal) after deleting the initial relatedc ado files, but these remedies doesn't work.

        Second is about the application about RIF decomposition. I wonder if there is some restrications about the covariates when decomposing the composition effect and wage structure effect into each covarite. In the paper FFL 2018 (Econometrics) which you have recommanded in other post, the covariates are all dummy variables.
        In my opinion, this arrangement is necessary to avoid the influence on detailed decomposition (especially the wage structure effect) made by parallel shift of continuous covariate, such as replacing x1 with (x1+5). I didn't find some specifications about this problem so I want to get your opinion about it.

        I would appreciate for your attention.

        Thank you.

        Comment


        • #5
          Hi Hongchang
          a few comments and answers.
          1st. you will do best by updating oaxaca_rif installing the larger package, type "ssc install rif".
          2nd. the no robust option comes from oaxaca itself. so try updating that first "ssc install oaxaca, replace". that should fix the robust warning message
          3rd. As far as i know, there are no restrictions in the parameters. What i describe in my paper (in SJ 20-1) is that more than being careful about the covariate itself, is to be careful about the interpretation.
          As you are already aware of, with continuous variables, the underlying assumption is a shift in the distribution (x_i ' = x_i + dx). for dummies is rather similar, as you analyze E(X') =E(X+dx). This means that you compare changes in proportions, not in individual values.
          My own take on the matter is not to use interactions directly, because they are more difficult to analyze. However, if you use centered interactions, you can interpret those as changes of the covariance in two variables.between two groups.

          Hope this helps
          Fernando

          Comment


          • #6
            Really thanks for your prompt response.

            I tried your first two advice and the problem about the command has been solved.

            About your third point (my second question), there maybe something wrong with my expression or my understanding about your comments, so I want to change the way to elaborate it. For example,
            a. run "oaxaca_rif wage educ exper tenure, by(female) wgt(1) rif(q(50)) rwlogit(educ exper tenure)" and get the detailed unexplained decomposition results into each covariate
            b. run "replace educ=educ+5"
            c. run "oaxaca_rif wage educ exper tenure, by(female) wgt(1) rif(q(50)) rwlogit(educ exper tenure)" again and get the new detailed unexplained decomposition results

            Compare these two results, I find the unexplained part caused by educ is different, which accompanys with the reverse change of the constant part(the unexplained diff. caused by constant). It means that the different definition of continuous covariates will affect its contribution to the unexplained difference,it's where I'm confused.
            Related to this problem, I also want to ask you to confirm my thinking about the constant part in the unexplained difference. I think the unexplained difference caused by constant is the pure discrimination, if the unexplianed diff. caused by educ represents "I pay your education less, because you are female", the constant part would represent "I pay you less because you are female". It's the importance of the interpretation about constant part that makes me put much attention on this problem, because the constant part can absord some effects caused by continuous variables that would make the pure discrimination no longer pure. And the paper FFL 2018 (Econometrics) don't show the constant part in the detailed decomposition result, which makes me more perplexed.

            Glad to see your insights!
            Hongchang

            Comment


            • #7
              Dear Fernando,

              Really thanks for your prompt response.

              I tried your first two advice and the problem about the command has been solved.

              About your third point (my second question), there maybe something wrong with my expression or my understanding about your comments, so I want to change the way to elaborate it. For example,
              a. run "oaxaca_rif wage educ exper tenure, by(female) wgt(1) rif(q(50)) rwlogit(educ exper tenure)" and get the detailed unexplained decomposition results into each covariate
              b. run "replace educ=educ+5"
              c. run "oaxaca_rif wage educ exper tenure, by(female) wgt(1) rif(q(50)) rwlogit(educ exper tenure)" again and get the new detailed unexplained decomposition results

              Compare these two results, I find the unexplained part caused by educ is different, which accompanys with the reverse change of the constant part(the unexplained diff. caused by constant). It means that the different definition of continuous covariates will affect its contribution to the unexplained difference,it's where I'm confused.
              Related to this problem, I also want to ask you to confirm my thinking about the constant part in the unexplained difference. I think the unexplained difference caused by constant is the pure discrimination, if the unexplianed diff. caused by educ represents "I pay your education less, because you are female", the constant part would represent "I pay you less because you are female". It's the importance of the interpretation about constant part that makes me put much attention on this problem, because the constant part can absord some effects caused by continuous variables that would make the pure discrimination no longer pure. And the paper FFL 2018 (Econometrics) don't show the constant part in the detailed decomposition result, which makes me more perplexed.

              Glad to see your insights!
              Hongchang

              Comment


              • #8
                Hi Hongchan
                Sorry for the confusion.
                So, the experiment (educ+5) is what you can use to think about a change in education that will modify the distribution (say 50th quantile) of the outcome. You, however, do not need to do that change manually.
                So, when you run the oaxaca decompsition, the explained component tries to capture this kind effect.
                Say group1 avg educ=5 and avg group2 educ=7 then the explained component explains what would happen when group1 increases education by 2.

                bottom line. do not do that type of change.

                regarding the constant interpretation.
                If you review some of the material on decomposition analysis, there is some emphasis on what it means to interpret the constant.
                if characteristics were exactly the same, (including unobservables), then the constant can be interpreted as "pure discrimination".. But most papers warn about that because it also contains differences of other factors. Namely, the interpretation of the constant (and overall detailed decomposition for categorical variables) is related to the choice of the base category when using dummies, and how constant should be interpreted in standard regression (the constant is the expected value of the outcome if all explanatory variables are =0).
                that is why some papers void talking about the constant, or interpret only the aggregated unexplained component.

                Finally, with regards to FFL 2018. They do show the constant. if you look table 3, wage structure effect, they have the constant as the last variable on the sublist.
                HTH

                Comment


                • #9
                  Dear Fernando,

                  Really thanks for your detail illustrations and kind reminders, also sorry for my late reply.
                  I will review some related papers to understand what you say better and deeper, your guidances really help me very much and I appreciate it.

                  Have a nice day!
                  Hongchang

                  Comment

                  Working...
                  X