Announcement

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

  • Computing predicted effect of one variable on another

    Hi, I have a data set with various different variables. I would like to compute the predicted effect on the hourly wages (one of my variables) of a change in education from 12 to 13 years. The way I have done it so far is by summarising the new variable hourwage_hat (created using the predict function) for each, so sum hourwage_hat if edu==12 and sum hourwage_hat if educ==13 and compare the mean manually using a calculator to tell the difference but I am almost certain that this is incorrect. I am convinced that a regression is involved somehow but I don't know how. Any help will be greatly appreciated!!!

  • #2
    Can you please share all variables that you have?
    I think that in this case you should run a regression and than, using the coefficients in the regression, run a prediction using the "first difference equation" or something like that.
    And in addition, maybe giving a variable name to ln(hourwage) could help

    I'm still a newbie but I think that's the way to do it.

    It should be something like:
    Code:
    regress lnhourwage edu
    Code:
    gen prediction_hw=(_b[edu]*13)-(_b[edu]*12)
    I'm not that sure, take it like an hint.

    Comment


    • #3
      My variables are age, educ (years of schooling), union (union membership), hours (hours worked), hrwage (hourly wage), lwage (log hourly wage), agegroup, exper (years of experience) and hrwage_hat (created using command predict hrwage_hat in an effort to solve this particular question)

      Thank you for your help but that command did not work im afraid so I'm still stuck!

      Comment


      • #4
        Welcome to Statalist.

        The predict command usually follows an estimation command, such as regress. Is that what you did - run regress hrwage ... educ ... and then run predict? Assuming educ is a variable included in the regression, then the coefficient on educ should be what you want: the estimated change in hrwage corresponding to a 1-unit change in educ. I'm assuming educ takes actual values 12 and 13, that they haven't been recoded into something else.

        But really, there's a lot more information we need to make a more certain answer than this guess at what you have done. Please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. Note especially sections 9-12 on how to best pose your question.

        The more you help others understand your problem, the more likely others are to be able to help you solve your problem.

        In this case, it would help if you were to copy your regress command and its output from your Stata Results window and paste it into your Statalist post - being sure to use CODE delimiters, as described in section 12 of the FAQ.

        Comment


        • #5
          From the information you gave us, I think this should be the answer.

          Code:
          gen lnhourwage = ln(hourwage)
          reg educ lnhourwage
          gen predict_hourwageincrease = (ln(13)-ln(12))*_b[lnhourwage]
          di predict_hourwageincrease
          If you want to have the percentage of change, you just have to add "*100" to the last command, after the variable name.

          Comment


          • #6
            Some prediction problems are better answered with the margins command. You might look at the contrast option on margins.

            While Antonio's approach is much more elegant, a brute force approach could use margins and predict for various values of lnhourwage, then look at the lnhourwage that associates with prediction of 12 and lnhourwage that associates with prediction of 13.

            Your question is also phrased in a little bit of an odd way. Normally, we think about changes in x resulting in changes in y. "The predicted effect on the hourly wages (one of my variables) of a change in education from 12 to 13 years" seems the opposite way. However, with only one regressor, that may be doable as Antonio suggests.

            Comment

            Working...
            X