Announcement

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

  • Wage Equations

    Hi- I'm working with wage equations, using the ORU (overeducation, required and under education) model specified by Duncan and Hoffman. I'm using one variation of the model which uses the mode of years of schooling per occupational group using ISCO two digit to determine required years of schooling. Anything above the mode is overeducation, anything under is undereducation, and anything equal is adequately educated. I inserted the below commands in Stata for my panel data set:
    by year country isco88, sort: egen yrschoolmode=mode(yrschool)
    by year country isco88, sort: generate overedu2=yrschool if yrschool>yrschoolmode

    by year country isco88, sort: generate underedu2=yrschool if yrschool<yrschoolmode
    by year country isco88, sort: generate matched2=yrschool if yrschool==yrschoolmode

    When I try to regress afterwards using pooled OLS:
    xi: regress logwage matched2 overedu2 underedu2 female exp exp2 disability married i.country, vce(robust)

    I just get no observations. Any ideas as to why that may be the case?

    Thanks,
    Ghia



  • #2
    Ghia:
    have you ruled out missing values issues?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      I see several issues here:

      Code:
      by year country isco88, sort: generate overedu2=yrschool if yrschool>yrschoolmode
      by year country isco88, sort: generate underedu2=yrschool if yrschool<yrschoolmode
      by year country isco88, sort: generate matched2=yrschool if yrschool==yrschoolmode
      1) The "by" does not help you here. You have already defined a variable for each observation containing the mode within each by group.

      2)Most relevant to your question: overedu2 will be missing for every observation for which yrschool <= yrschoolmode. Similarly, underedu2 will be missing for every observation for which yrschool >= yrschoolmode. Finally, matched2 is missing whenever yrschool != yrschoolmode
      Therefore, every observation will be missing on one of these variables, so every observation will be excluded from the regression model.

      3) You're assigning yrschool to every observation,even though you are putting its value into a different variable. Are you sure this is what you want. Perhaps you wanted an indicator like:
      generate overedu2 = (yrschool > yrschoolmode)

      Regards, Mike

      Comment


      • #4
        Mike has identified the crux of the problem.

        After that, there is one subtle point you may need to look into: -egen, mode()- when, as here, invoked without any options specified will return missing values if the distribution is multimodal. That might happen in your data and lead to either loss of observations from analysis or incorrect results.

        Comment


        • #5
          Thanks so much Mike and Clyde. This works great for when I'm creating dummy variables, but do you have any tips re: if I wanted to have continuous variables capturing years of overeducation and undereducation?

          Comment


          • #6
            Do you mean something like:

            Code:
            gen yrs_over_education = cond(yrs_school > yrs_school_mode, yrs_school-yrs_school_mode, 0)
            gen yrs_under_education = cond(yrs_school < yrs_school_mode, yrs_school_mode-yrs_school, 0)
            That said, in most situations that spring to my mind, it would be more useful to have a single variable characterizing the deviation of the individual's education from the central value, which might be either positive or negative (or zero).

            Code:
            gen dev_education = yrs_school-yrs_school_mode

            Comment


            • #7
              Perfect thank you! Just for me to understand what does this part of the code specify in the command?
              (yrs_school_mode-yrs_school, 0)
              Last edited by Ghia Osseiran; 17 Mar 2015, 13:10.

              Comment


              • #8
                Found my answer through "help cond." Thank you.

                Comment

                Working...
                X