Announcement

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

  • Saving tabulated dummy variable scalars (i.variable)

    Hello,

    I'm trying to run an estimation for my honours thesis detailed in this paper (open-source version): https://www.lifecoursecentre.org.au/...Siminski-2.pdf, though with a longer dataset.

    I am attempting to replicate equation 3 (page 13), however am unsure on how to save the scalars for occupation from equation 2 (page 12).

    My initial regression is as follows:

    reg income i.occupation age age^2

    I have estimated the coefficients of different occupations by creating tabulated dummies with the data, however where creating a scalar for the constant, age and age^2 is simple enough, the function does not work with the variable i.occupation.

    Does anyone know how I can save the coefficients of these dummies? Many thanks in advance!

  • #2
    I do not know what function you are referring to, but you access the coefficient for the factor variable like this:

    Code:
    . sysuse auto
    (1978 Automobile Data)
    
    . tab rep
    
         Repair |
    Record 1978 |      Freq.     Percent        Cum.
    ------------+-----------------------------------
              1 |          2        2.90        2.90
              2 |          8       11.59       14.49
              3 |         30       43.48       57.97
              4 |         18       26.09       84.06
              5 |         11       15.94      100.00
    ------------+-----------------------------------
          Total |         69      100.00
    
    . reg price i.rep
    
          Source |       SS           df       MS      Number of obs   =        69
    -------------+----------------------------------   F(4, 64)        =      0.24
           Model |  8360542.63         4  2090135.66   Prob > F        =    0.9174
        Residual |   568436416        64     8881819   R-squared       =    0.0145
    -------------+----------------------------------   Adj R-squared   =   -0.0471
           Total |   576796959        68  8482308.22   Root MSE        =    2980.2
    
    ------------------------------------------------------------------------------
           price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           rep78 |
              2  |   1403.125   2356.085     0.60   0.554    -3303.696    6109.946
              3  |   1864.733   2176.458     0.86   0.395    -2483.242    6212.708
              4  |       1507   2221.338     0.68   0.500    -2930.633    5944.633
              5  |     1348.5   2290.927     0.59   0.558    -3228.153    5925.153
                 |
           _cons |     4564.5   2107.347     2.17   0.034     354.5913    8774.409
    ------------------------------------------------------------------------------
    
    . dis _b[2.rep]
    1403.125
    
    . dis _b[5.rep]
    1348.5
    
    .

    Comment


    • #3
      Thanks for this! What I'm trying to do is then run the following estimation:

      fatherincome = constant + a*i.fatheroccupation + b*age + c*age^2

      where i.fatheroccupation is a set of dummy variables which align with those from i.occupation, and 'a' is the set of coefficients estimated for i.occupation in the first regression detailed in my first post.

      This is why I would like to save the coefficients of the dummy variables in the first equation ('a').

      Does this make more sense? Is there anyway to do what I'm hoping to do?

      Comment


      • #4
        Use predict after regress to get predicted or fitted values.

        Code:
        help regress postestimation

        Comment

        Working...
        X