Announcement

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

  • How to generate the highest education Level at wave X, given the data from all previous survey waves?

    Dear All,

    I am working with longitudial survey and my dataset contains a data from the 7th Survey wave.
    I am interested in the highest education level attained by the participant at the Point of time of 7th Survey wave. However, when I am working with the 7th wave, I only have the current education status variable.


    I have an Access to the previous waves and participants id

    How do I generate the highest education Level, given the data that I have from all previous survey vawes?

    Example: In the Picture below, there are 1704 participants that pursue no education at the time of survey, but I do not know if they have no educataion at all, or they finished their education before this Survey wave.

    Click image for larger version

Name:	edu1.png
Views:	1
Size:	35.1 KB
ID:	1515429



    Thank you in Advance!
    Attached Files

  • #2
    Please post back showing relevant example data to get help with code. Be sure to use -dataex- to do that.

    If you are running version 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    When asking for help with code, always show example data. When showing example data, always use -dataex-.

    Comment


    • #3
      Thank you for your Reply.

      I have merged the 7th wave (The one I am using) with all previous waves to include the current education variable.

      Here is the Code:
      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input long id byte(t7educ22 t2educ22 t3educ22 t4educ22 t5educ22 t6educ22)
      11001001 90  4  4  4 90 90
      11001002 90  4  4 90 90 90
      11001003 .a .a .a .a .a .a
      11002002 15  4  4  4  9 90
      11002003 90  4 19  4  4  4
      11002004 .a .a .a .a .a .a
      11002005 15  4  4  4 90  9
      11002006 22  4  4  4 90 90
      11002009 16  5  5  8  8 16
      11002010 90  4  4  4  4  9
      11002011 .a  5  5 90  9 15
      11002013 15  8  8  8 22 15
      11002015 .a .a .a .a .a .a
      11002016 16  8  8  8 90 16
      11003002 .a  4  4 .a .a .a
      11004001 90  4  4  4 13 13
      11004002 .a  4 .a .a .a .a
      11004003 .a .a  4 .a .a .a
      11005001 90  4  4  4 90 22
      11005002 90  4  4  4 90 .a
      11005003 .a  4  4  4 .a .a
      11006001 14 19  4  4  4 90
      11006002 .a  5  5 .a .a .a
      11006003 11 20  4  4  4  4
      11006004 90  4  4  4 90 90
      11006005  4 19 19 19 19 19
      11006006 .a 19 90 .a .a .a
      11006007 .a  4  4  4 .a .a
      11006008 90  4 .a  4 90 90
      11007002 90  4  4  4 90 90
      11007003 90  4  4  4 90 90
      11007004 22 22  4  4  4 90
      11008001 90  4  4  4  4 90
      11008002 .a  4 .a .a .a .a
      11009004 .a .a .a .a .a .a
      11009005 .a  1  4  4  4 90
      11009006 90 19  3 13 13 13
      11009007 90  4  4 22 90 .a
      11009008 .a .a .a .a .a .a
      11009010 .a .a .a .a .a .a
      11009011 15  4  4 11 90 90
      11010001 .a .a .a .a .a .a
      11010004 14 90 .a .a .a .a
      11010005 .a .a  4 .a .a .a
      11010007 90  4  4  4 90 90
      11010008 .a  4  4 .a .a .a
      11010009 90  4  4  4  4 90
      11013001 90  4  4 .a 90 90
      11013002 .a .a .a .a .a .a
      11013003 90  4  4 90 90 90
      11013004 .a .a .a .a .a .a
      11013005 .a  3 .a .a .a .a
      11013006 .a  4 .a .a .a .a
      11013007 .a  4  4  4 90 .a
      11013008 90  4  4 .a 90 90
      11013009 .a  4  4 .a 90 .a
      11014001 .a .a .a .a .a .a
      12001001 .a  4  4 .a 90 90
      12001002 90  4  4  4 90 90
      12001005 .a .a .a .a .a .a
      12001006 14  4  4  4 90 14
      12001008 .a .a .a .a .a .a
      12001009 14  4  4  4 90 .a
      12002003 .a  4 .a  4 90 .a
      12002004 90  4  4  4 90 22
      12002005 .a 90 .a .a .a .a
      12002006 .a .a .a .a .a .a
      12002011 .a .a .a .a .a .a
      12002020 .a  4  4 90 .a 13
      12002024 90  4  4  4  4 90
      12003001 .a  4  4 90 90 90
      12003005 .a  4  4 .a .a .a
      12003006 .a  4  4  4 90 .a
      12003008 90  4  4  4 90 90
      12003010 .a  4  4 .a .a .a
      12003011 13  4  4  4 90 13
      12003012 13  6 13 13 13 13
      12003013 11  4  4 90 11 11
      12003014 90  5  5 90 90 90
      12003015 .a .a .a .a .a .a
      12003016 .a  4  4  4 90 90
      12003017 .a 90 .a 90 90 .a
      12003018 .a  4  4  4  4 .a
      12003021 90 .a  4  4  4 90
      12003023 90 90 .a 90 90 .a
      12003025 .a 21 13 .a .a .a
      12003028 .a .a .a .a 90 90
      12003029 90  4 .a 90 90 90
      12003030 90  4  4 22 14 90
      12003035 14  4  4  4 90 90
      12003036  4 .a  4 90 .a  4
      12004001 90  4  4 .a .a .a
      12004002 90  4  4 90 90 90
      12004003 .a  4  4  4 90 90
      12004004 .a  4 .a 90 .a 90
      12004006 90  4  4  4 90 90
      12004009 22  4 90  4  4 90
      12004014 15  4  4 90 15 15
      12004016 90  4  4 .a 90 90
      12004017 .a .a .a .a .a .a
      end
      label values t7educ22 t7educ22_l
      label def t7educ22_l 4 "apprenticeship with federal diploma of vocational education and training (Eidgenössisches Fähigkeitszeugnis) or equivalent (3 or 4 years)", modify
      label def t7educ22_l 11 "professional baccalaureate/vocational matura (after education besides employment)", modify
      label def t7educ22_l 13 "higher specialised school", modify
      label def t7educ22_l 14 "higher vocational education and training (Advanced Federal Certificate/Federal Diploma of Higher VET)", modify
      label def t7educ22_l 15 "university of applied sciences/universities of teacher education (Bachelor)", modify
      label def t7educ22_l 16 "universities and federal institutes of technology (ETH) (Bachelor/Master/Diploma)", modify
      label def t7educ22_l 22 "other education", modify
      label def t7educ22_l 90 "no education", modify
      label def t7educ22_l .a "not administered, wave", modify
      label values t2educ22 t2educ22_l
      label def t2educ22_l 1 "courses to bridge gaps in training", modify
      label def t2educ22_l 3 "apprenticeship with basic federal certificate of vocational education and training (2 years)(Berufsattest)", modify
      label def t2educ22_l 4 "apprenticeship with federal diploma of vocational education and training (Eidgenössisches Fähigkeitszeugnis) or equivalent (3 or 4 years)", modify
      label def t2educ22_l 5 "commercial college (WMS)", modify
      label def t2educ22_l 6 "specialised middle schools (FMS/DMS)", modify
      label def t2educ22_l 8 "academic matura school", modify
      label def t2educ22_l 19 "internship (not part of education)", modify
      label def t2educ22_l 20 "language stay, Au-Pair", modify
      label def t2educ22_l 21 "pre-course (in order to enter higher education)", modify
      label def t2educ22_l 22 "other education", modify
      label def t2educ22_l 90 "no education", modify
      label def t2educ22_l .a "not administered, wave", modify
      label values t3educ22 t3educ22_l
      label def t3educ22_l 3 "apprenticeship with basic federal certificate of vocational education and training (2 years)(Berufsattest)", modify
      label def t3educ22_l 4 "apprenticeship with federal diploma of vocational education and training (Eidgenössisches Fähigkeitszeugnis) or equivalent (3 or 4 years)", modify
      label def t3educ22_l 5 "commercial college (WMS)", modify
      label def t3educ22_l 8 "academic matura school", modify
      label def t3educ22_l 13 "higher specialised school", modify
      label def t3educ22_l 19 "internship (not part of education)", modify
      label def t3educ22_l 90 "no education", modify
      label def t3educ22_l .a "not administered, wave", modify
      label values t4educ22 t4educ22_l
      label def t4educ22_l 4 "apprenticeship with federal diploma of vocational education and training (Eidgenössisches Fähigkeitszeugnis) or equivalent (3 or 4 years)", modify
      label def t4educ22_l 8 "academic matura school", modify
      label def t4educ22_l 11 "professional baccalaureate/vocational matura (after education besides employment)", modify
      label def t4educ22_l 13 "higher specialised school", modify
      label def t4educ22_l 19 "internship(not part of education)", modify
      label def t4educ22_l 22 "other education", modify
      label def t4educ22_l 90 "no education", modify
      label def t4educ22_l .a "not administered, wave", modify
      label values t5educ22 t5educ22_l
      label def t5educ22_l 4 "apprenticeship with federal diploma of vocational education and training (Eidgenössisches Fähigkeitszeugnis) or equivalent (3 or 4 years)", modify
      label def t5educ22_l 8 "academic matura school", modify
      label def t5educ22_l 9 "professional baccalaureate/vocational matura (full time after education)", modify
      label def t5educ22_l 11 "professional baccalaureate/vocational matura (after education besides employment)", modify
      label def t5educ22_l 13 "higher specialised school", modify
      label def t5educ22_l 14 "higher vocational education and training (Advanced Federal Certificate/Federal Diploma of Higher VET)", modify
      label def t5educ22_l 15 "university of applied sciences/universities of teacher education (Bachelor)", modify
      label def t5educ22_l 19 "internship (not part of education)", modify
      label def t5educ22_l 22 "other education", modify
      label def t5educ22_l 90 "no education", modify
      label def t5educ22_l .a "not administered, wave", modify
      label values t6educ22 t6educ22_l
      label def t6educ22_l 4 "apprenticeship with federal diploma of vocational education and training (Eidgenössisches Fähigkeitszeugnis) or equivalent (3 or 4 years)", modify
      label def t6educ22_l 9 "professional baccalaureate/vocational matura (full time after education)", modify
      label def t6educ22_l 11 "professional baccalaureate/vocational matura (after education besides employment)", modify
      label def t6educ22_l 13 "higher specialised school", modify
      label def t6educ22_l 14 "higher vocational education and training (Advanced Federal Certificate/Federal Diploma of Higher VET)", modify
      label def t6educ22_l 15 "university of applied sciences/universities of teacher education (Bachelor)", modify
      label def t6educ22_l 16 "universities and federal institutes of technology (ETH) (Bachelor/Master/Diploma)", modify
      label def t6educ22_l 19 "internship (not part of education)", modify
      label def t6educ22_l 22 "other education", modify
      label def t6educ22_l 90 "no education", modify
      label def t6educ22_l .a "not administered, wave", modify

      Comment


      • #4
        This is pretty complicated, and my proposed solution may or may not work. But perhaps it will at least point you in a useful direction.

        I'm going to make two very strong assumptions:

        1. The numeric coding of these variables, up through 16, corresponds to least through most formal education. (There are categories in your education variables that I am unfamiliar with and don't really know where they fit in order. So I'm assuming the numeric order reflects attainment order, at least up through 16.)

        2. The educational activities coded with numbers above 17 are, in fact, not formal education, and do not count in determining the highest education achieved.

        Code:
        foreach v of varlist t*educ22 {
            gen rcd_`v' = `v'
            recode rcd_`v' (17/.z = .)
        }
        egen highest_education = rowmax(rcd_*)
        drop rcd_*

        Comment


        • #5
          Thank you. It works to some extent. However, at the end I am missing participants with no education (numeric Code 90). But there are not that many, so I will try to edit that manually.


          Comment

          Working...
          X