Announcement

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

  • not estimable margins after reghdfe

    Dear Statalisters,
    I have a problem in computing the margins of a linear fixed effects regression that I have not managed to solve by looking at previous posts - I apologies in case I overlooked similar issues that had already been discussed.

    I am running the following regression:
    Code:
    reghdfe DV cit_intern cit_hostcountry cit_hostcountry#ownethmig_max $CONTROLS , abs(i.patent i.cat_code) vce(cluster patent)
    where:
    DV is a binary variable;
    ownethmig_max is collinear with patent fixed effects (and this is the reason why I did not use cit_hostcountry##ownethmig_max);
    both cit_hostcountry and ownethmig_max are dychotomous variables.

    I would like to compute average marginal effects of cit_hostcountry at different values of ownethmig_max in order to plot the results using marginsplot to better explain the results of the regressions.The following example is a simple one, but the final goal is to plot the marginal effects of a subsample analysis for four groups in the same graph.

    In a previous similar model specification without patent fixed effects, I used:
    Code:
    margins, dydx(i.cit_hostcountry) over(ownethmig_max) post vsquish
    marginsplot
    This code gave me as result the following graph:
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	11.8 KB
ID:	1523097



    Once I introduce the patent fixed effects, the margins command gives me the following output:
    Code:
    Average marginal effects                          Number of obs   =     306546
    Model VCE    : Robust
    
    Expression   : Linear prediction, predict()
    dy/dx w.r.t. : 1.cit_hostcountry
    over         : ownethmig_max
    
    ------------------------------------------------------------------------------------
                       |            Delta-method
                       |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------------+----------------------------------------------------------------
    1.cit_hostcountry  |
         ownethmig_max |
                    0  |          .  (not estimable)
                    1  |          .  (not estimable)
    ------------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    Is there any alternative approach to correctly compute average marginal effects and plot the results as in the previous model specification?

    Any insights would be much appreciated.

    Thank you,
    Alba

  • #2
    You can force Stata to give you results for these parameters by adding the -noestimcheck- parameter to the -margins- command. You should not do this indiscriminately in the future: most of the time when Stata gives you this result it is because the parameters you are asking about are truly not estimable, and the results you get with -noestimcheck- would not be valid. But in this instance, the parameters are, indeed, estimable. So go ahead and do it here.

    That said, are you sure you want the -over()- option in your -margins- command? It is a legitimate statistical calculation to make, but it is usually not what people want. If you are looking for average marginal effects with adjustment for your $CONTROLS, then the code should be:
    Code:
    margins ownethmig_max, dydx(cit_hostcountry) post vsquish noestimcheck
    What the -over()- option gives you is a separate calculation of the marginal effect of cit_hostcountry in the two subsets of the data defined by the two values of ownethmig_max. Thus, the results with -over()- do not take into account the actual distribution of ownethmig_max, and they adjust for the $CONTROLS differently in each subset (unless the $CONTROLS have identical distributions in both subsets, which seldom happens.) These results are meaningful in their own right, but they are not what people usually mean when the speak of adjusted average marginal effects.

    Comment


    • #3
      Dear Clyde,
      thank you very much for your suggestion. The -estimcheck- parameter allows to compute the parameters.

      For what concerns the syntax of my command, our aim is to depict the "total effect" of cit_hostcountry (from both the linear term and the interaction) for different values of ownethmig_max. In other words, we want to understand how the effect changes for different values of the other dummy variable – that in turn indicates a characteristic of the observation –.
      I am not sure whether referring to these results as "average marginal effects" is appropriate, but I chose this approach after reading some material (i.e., the presentation by Ben Jann here).

      In previous analysis I also used the following code:
      Code:
      margins, dydx(cit_hostcountry) at(ownethmig_max=(0(1)1)) post vsquish
      However, I run all the calculations (both my specifications and yours) and they hold the same exact results.

      Regards,
      Alba

      Comment


      • #4
        -margins ownethmig_max, dydx(cit_hostcountry)- and -margins, dydx(cit_hostcountry) at(ownethmig_max=(0(1)1))- are synonymous. They will always give you the same results.

        However, -margins, dydx(cit_hostcountry) over(ownethmig_max)- calculates something different. If your model contains no other terms that involve interactions between cit_hostcountry and other variables, (which may be the case in your model--I don't know what $CONTROLS contains) then the results will be the same either way. But otherwise they will be different.

        Both have a claim to being "the total effect" of cit_hostcountry and in that case some thought needs to be given as to which is the statistic you intend. They differ in how they adjust for the other variables in the model.

        Comment


        • #5
          Originally posted by Clyde Schechter View Post
          You can force Stata to give you results for these parameters by adding the -noestimcheck- parameter to the -margins- command. You should not do this indiscriminately in the future: most of the time when Stata gives you this result it is because the parameters you are asking about are truly not estimable, and the results you get with -noestimcheck- would not be valid. But in this instance, the parameters are, indeed, estimable. So go ahead and do it here.

          That said, are you sure you want the -over()- option in your -margins- command? It is a legitimate statistical calculation to make, but it is usually not what people want. If you are looking for average marginal effects with adjustment for your $CONTROLS, then the code should be:
          Code:
          margins ownethmig_max, dydx(cit_hostcountry) post vsquish noestimcheck
          What the -over()- option gives you is a separate calculation of the marginal effect of cit_hostcountry in the two subsets of the data defined by the two values of ownethmig_max. Thus, the results with -over()- do not take into account the actual distribution of ownethmig_max, and they adjust for the $CONTROLS differently in each subset (unless the $CONTROLS have identical distributions in both subsets, which seldom happens.) These results are meaningful in their own right, but they are not what people usually mean when the speak of adjusted average marginal effects.
          My god, @Clyde Schechter : you can't imagine how much you helped me out with the "noestimcheck" option. Thank you so much for that suggestion!

          Comment


          • #6
            Originally posted by Clyde Schechter View Post
            You can force Stata to give you results for these parameters by adding the -noestimcheck- parameter to the -margins- command. You should not do this indiscriminately in the future: most of the time when Stata gives you this result it is because the parameters you are asking about are truly not estimable, and the results you get with -noestimcheck- would not be valid. But in this instance, the parameters are, indeed, estimable. So go ahead and do it here.

            That said, are you sure you want the -over()- option in your -margins- command? It is a legitimate statistical calculation to make, but it is usually not what people want. If you are looking for average marginal effects with adjustment for your $CONTROLS, then the code should be:
            Code:
            margins ownethmig_max, dydx(cit_hostcountry) post vsquish noestimcheck
            What the -over()- option gives you is a separate calculation of the marginal effect of cit_hostcountry in the two subsets of the data defined by the two values of ownethmig_max. Thus, the results with -over()- do not take into account the actual distribution of ownethmig_max, and they adjust for the $CONTROLS differently in each subset (unless the $CONTROLS have identical distributions in both subsets, which seldom happens.) These results are meaningful in their own right, but they are not what people usually mean when the speak of adjusted average marginal effects.
            Dear Dr.Schecher, how should one check whether a variable is "truly not estimable"?

            Comment

            Working...
            X