Announcement

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

  • Calculate % coefficient effect after regression

    Hey everybody,
    I have a regression:

    Code:
    xtreg IMD ulc GDPpc capitalform mor sen  pop pat fd van_index i.year , fe ro
    and I would like to calculate the % ulc
    effect which is the ratio of the coefficient divided by the linear prediction (and multiplied by 100), however I don't know how to calculate the "linear prediction" after the FE regression (the coefficient of ulc in my model is -0.018).

    Thank you in advance!
    Stay safe!
    Sincerely,
    John Economou.

  • #2
    You need to clarify what you mean by the model's linear prediction. Do you mean for it to include the absorbed panel effect, or not? Either way, you would use the -predict- command after -xtreg-. If you want the panel effect included, it's -predict linear_effect, xbu-. If not, it's -predict linear_effect, xb-.See -help xtreg postestimation- and click on the blue link called predict for more information.

    Comment


    • #3
      Clyde, thanks a lot for your response!
      However, I think that I want to calculate something else.
      Specifically, the authors of this paper (https://www.sciencedirect.com/scienc...13001748#t0010) calculate the 'linear prediction' of the model, which is a number (e.g. 0.0159), not a vector (see Table 2).
      Simirarly here http://ftp.iza.org/dp10633.pdf (see Table 4, etc.).
      I want something like those...

      Thanks again!

      Comment


      • #4
        The first of those papers is behind a paywall. The second is freely available, and uses the term linear prediction freely but never provides a definition or formula. I'm afraid I don't know what they are referring to. The only meaning I have ever known for the term is the one calculated by -predict-, but clearly that is not what you need. I'm sorry.

        Comment


        • #5
          Specifically, the authors of this paper (https://www.sciencedirect.com/scienc...13001748#t0010) calculate the 'linear prediction' of the model, which is a number (e.g. 0.0159), not a vector (see Table 2).
          Click image for larger version

Name:	Untitled.png
Views:	1
Size:	213.9 KB
ID:	1547896


          So here they estimate a linear probability model, i.e., linear regression with a binary dependent variable (coded 0/1). The prediction is the average predicted dependent variable which is what margins gives you by default.

          Code:
          sysuse auto, clear
          regress foreign mpg weight disp gear
          predict foreignhat, xb
          sum foreignhat
          margins
          Res.:

          Code:
          . predict foreignhat, xb
          
          .
          . sum foreignhat
          
              Variable |        Obs        Mean    Std. Dev.       Min        Max
          -------------+---------------------------------------------------------
            foreignhat |         74    .2972973     .334918  -.4234509    .941747
          
          .
          . margins
          
          Predictive margins                              Number of obs     =         74
          Model VCE    : OLS
          
          Expression   : Linear prediction, predict()
          
          ------------------------------------------------------------------------------
                       |            Delta-method
                       |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                 _cons |   .2972973   .0377362     7.88   0.000     .2220157    .3725789
          ------------------------------------------------------------------------------
          Last edited by Andrew Musau; 19 Apr 2020, 05:26.

          Comment


          • #6
            Thank you Andrew!

            Comment

            Working...
            X