Announcement

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

  • Impact of change in independent variables (after linear regression)

    Hello,

    I'm a bit of a lightweight in Stata so bear with me.

    I'm doing an linear regression and trying to perform a deeper analysis of the results.

    After computing the regress, i would like to compute the exact impact of independent variables on dependent variable. More precisely, i would like to know the effect on the dependent variable, resulting from a change from median to maximum value on my independent variables.

    For example: When X1 goes from median to maximum, Y changes "0.15" - based on the previous linear regress.

    I've looked into the margins option but am not clear exactly how to compute the exact change.

    Any help with a command or advice would be appreciated.

    Thanks in advance.

    P.S. I'm using Stata 12.0 on Mac OSX.

  • #2
    So something like this:

    Code:
    regress Y X1 // maybe other variables too
    summ X1, detail // SEE NOTE BELOW
    local deltaX = `r(max)' - `r(p50)'
    display "deltaY = "  =_b[X1]*`deltaX'
    NOTE: This code assumes you want the median and maximum values of X1 in the entire data set. That may be different from the estimation sample for the regression because any observation that has a missing value on any variable in the regression is excluded from the regression. If you want the median and maximum for just the estimation sample, add -if e(sample)- to the end of the regression command.

    Comment


    • #3
      Thank you, this produced exactly the intended result!

      Comment


      • #4
        Dear Tja2, please note the forum's etiquette for preference of Original names (First and Surname) here. You can hit the 'contact us' tab at the bottom right hand corner of this page and request the admin to change your name.
        Best,
        Roman

        Comment


        • #5
          "If you want the median and maximum for just the estimation sample, add -if e(sample)- to the end of the regression command." Actually add it to the end of the summarize command. Otherwise right on.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment

          Working...
          X