Announcement

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

  • Calculating years of schooling

    I am trying to calculate total years of schooling based on year highest level of education was attained and the year of birth. From that I would like to calculate total years of schooling as follows:
    Year highest level of education was attained- year of birth- 4

    say variable x= Year highest level of education was attained

    y=year of birth
    I'm trying the stata command
    "generate yrschooling= x-y-4"

    But that doesn't work as I'm getting numbers from -59 to 61. Any ideas what the correct command should be?

    Thanks.




  • #2
    We don't know for certain what educational system you are referring to unless you tell us. But the command looks plausible to me, so you must tell us (much) more about your data. The results of

    Code:
    d x y
    l x y in 1/10
    su x y
    might help.

    Also: "decipheringstata" doesn't look like a real name to me. We have a strong preference here for full real names. Please read the FAQ Advice.
    Last edited by Nick Cox; 27 Nov 2014, 14:03.

    Comment


    • #3
      Your method looks right from here; there must be some problems with your data. Try, for example (with your real variable names):
      Code:
      list id x y if yrschooling<1 | yrschooling>20
      Please note the strong preference at this list for people using their real first and last names.

      Comment

      Working...
      X