Announcement

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

  • At which value of IV is DV equal to a certain value?

    Hello Stata community,

    I have been struggling recently with finding the correct command in Stata that helps me to answer the following question: At which value of the independent variable (X) is the dependent variable (Y) equal to a certain value?

    At the moment, I am running a model where I look at the influence of a certain firm strategy (X) on firm profitability (Y)

    I found that in order to find the estimated profitability at a certain point of my X (e.g. the estimated firm profitability at the point where X = 0.02), I need to use the following code:
    xtreg firm_profitability firm_strategy
    margins, at(firm_strategy=(0.02))

    However, I am struggling to find the correct Stata commands to calculate for example at which point of the firm_strategy X the estimated firm_profitability Y will reach a value of 10%?

    Thanks & all the best,
    Franz
    Last edited by Franz Hopp; 26 Aug 2019, 08:42.

  • #2
    So your model is

    firm_profitability = a + b * firm_strategy

    and, knowing the coefficient estimates a-hat and b-hat you want to find the value of firm_strategy for which firm_profitability is 0.10, so that

    0.10 = a-hat + b-hat * firm_strategy

    Solving that equation for firm_strategy gives

    firm_strategy = ( 0.10 - a-hat ) / b-hat

    (This assumes you represent 10% as 0.10; if you represent it as 10 make the appropriate change.)

    Comment


    • #3
      William, thanks so much. I should have clarified in the above that my model that my models includes a number of control variables (around 15)
      Would this change the equation you mentioned above (firm_strategy = ( 0.10 - a-hat ) / b-hat)?

      Is there any way to compute the respective values in Stata with a command automatically?

      (I should perhaps also mention that my model is a fixed effects model with the vce(cluster Firm) option)
      Last edited by Franz Hopp; 26 Aug 2019, 10:14.

      Comment


      • #4
        As you now describe it, the value of firm_strategy for which firm_profitability is 0.10 will depend on the values chosen for your control variables.

        You know from your margins command that you get a value we will call fp* for firm_profitability when firm_strategy=0.02

        fp* = b_hat * .02 + (contribution of constant and covariates)

        and you want to use that to solve

        0.10 = b_hat * firm_strategy + (contribution of constant and covariates)

        Subtracting the two and solving gives

        ( ( 0.10 - fp*) / b-hat ) + 0.02 = firm_strategy

        which works (I hope) because the contribution of constant and covariates doesn't change when you only change the specified value of firm_strategy. This wouldn't work for a more complicated model, like xtlogit. But it should work for xtreg. Try it and plug in the value you get for firm_strategy into the margins command and see if the result is 0.10.

        To the best of my knowledge, there is no way to convince the margins command to directly calculate what you seek. There are approaches using numerical optimization (the minbound command comes to mind), but that takes a certain amount of learning and programming.

        The quick answer with the most generality is to run margins with a list of values for firm_strategy, and use those results to narrow down the range within which 0,10 occurs, and rerun margins with a list in the narrower range, and continue that process of successive narrowing until you find a result that's satisfyingly close to 0.10.

        Comment

        Working...
        X