Announcement

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

  • Adding together variables

    Hello, I apologize in advance for my lack of knowledge concerning STATA as I am not familiar with it and am currently trying to get better. Also, I am not familiar with this forum, so I may be posting in the wrong section. Regardless, here we go. I am currently conducting a research paper for economics on the impact of minimum wages on employment. I imported data from IPUMS into STATA and am currently manipulating the data to fit my needs. One of my variables is employment status, and within that variable are a number of options (i.e. military, retired, not in labor force other, unemployed, unemployed new worker etc. I would like to, if possible, combine these into two categories, specifically employed and unemployed (so that I may create a dummy variable for employment without omitting data). Is there a way to do this? If so, how? Thanks in advance!

    Note: These are the options for employment that I would like to combine into employed and unemployed

    employment status | Freq. Percent Cum.
    -------------------------------+-----------------------------------
    armed forces | 2,671 0.57 0.57
    at work | 213,509 45.39 45.95
    has job, not at work last week | 6,871 1.46 47.42
    unemployed, experienced worker | 21,502 4.57 51.99
    unemployed, new worker | 7,825 1.66 53.65
    nilf, unable to work | 7,743 1.65 55.30
    nilf, other | 209,331 44.50 99.79
    nilf, retired | 965 0.21 100.00
    -------------------------------+-----------------------------------
    Total | 470,417 100.00


  • #2
    Welcome to Statalist. No need to apologize for being new to Stata and just learning. We all were at one time. And most of the people who post asking questions are also new users. And this is the correct place to post this kind of question.

    There are a couple of ways your post could be improved. One is not to use abbreviations like IPUMS, nor any other specialized terms, that would not be immediately understood by any college-educated person. This is a multi-disciplinary and international forum. What is every-day terminology to you may leave others completely baffled. In this case, knowing that the data comes from IPUMS really makes no difference, so perhaps best not to say more than that it is Census data. If the source were relevant, it would be necessary to explain it in sufficient detail that somebody who didn't previously know about it could find it and find out about its structure, etc. Similarly, you should explain that "nilf" means "not in labor force."

    Another important aspect of effective posting is to always show example data when asking for help with code. The code often depends on details that will not show up in tabulations, listings, and descriptions. This is the case here. You cannot get a good answer to your question based on what you have shown, because the best code for the task depends on the storage type or labeling of the employment variable. In showing data examples, always, always use the -dataex- command. If you are running version 15.1 or a fully updated version 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.

    If you post back with an example of your data, I'm confident you will get a timely and helpful response.

    Comment


    • #3
      Clyde, thank you for the quick response with helpful information! As far as sharing the results from inputting the -dataex- command, should I just copy and paste what shows up? (as in the results that are displayed when I type in that command). I ask this because I do not fully understand everything that comes up when using that command, and am not sure if that is what is appropriate. I will include what pops up here in case it is appropriate, otherwise I will follow further instruction. I apologize ahead of time if copy and pasting the results was not what you meant. Thank you!

      . dataex

      ----------------------- copy starting from the next line -----------------------
      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input int year long serial byte month double(hwtfinl cpsid) byte(asecflag hflag) double asecwth byte(statefip pernum) double(wtfinl cpsidp asecwt) byte(age sex) int race byte(marst empstat labforce) int(ind educ) double hourwage float diploma
      2008 63346 3 .              0 1 . 1289.97 1 1 .              0 1289.97 42 1 200 1 10 2  490  73 99.99 .
      2008 63176 3 . 20070200025200 1 . 1335.57 1 1 . 20070200025201 1335.57 33 2 200 1 34 1    0  81 99.99 .
      2008 63175 3 . 20070100032800 1 . 1556.03 1 2 . 20070100032803 1556.03 43 1 802 1  1 0    0  81 99.99 .
      2008 62890 3 . 20070100005300 1 . 2989.82 1 3 . 20070100005302 2989.82 20 1 200 6 10 2 6990  81 99.99 .
      2008 62402 3 . 20080200057100 1 . 3452.06 1 1 . 20080200057101 3452.06 73 2 100 1 36 1    0  20 99.99 .
      2008 63407 3 . 20070100015700 1 . 1227.07 1 1 . 20070100015701 1227.07 50 2 200 1 10 2 6470  73 99.99 .
      2008 63423 3 .              0 1 . 1719.52 1 3 .              0 2097.72  0 2 200 6  0 0    0   1 99.99 .
      2008 62691 3 . 20070100057600 1 .  977.28 1 5 . 20070100057606 1146.24 16 2 200 6 34 1    0  30 99.99 .
      2008 63386 3 . 20071200006000 1 . 1572.91 1 3 . 20071200006003  1468.2 16 2 200 6 34 1    0  40 99.99 .
      2008 62442 3 .              0 1 . 1601.98 1 4 .              0 1565.48 16 1 200 6 34 1    0  40 99.99 .
      2008 62696 3 . 20070200062800 1 . 1310.87 1 1 . 20070200062801 1310.87 49 1 200 1 32 1    0  91 99.99 .
      2008 62447 3 .              0 1 . 1148.65 1 1 .              0 1148.65 60 2 200 1 36 1    0  73 99.99 .
      2008 62815 3 . 20071200006200 1 . 1390.29 1 2 . 20071200006202 1318.82 78 2 200 5 36 1    0  73 99.99 .
      2008 62571 3 . 20080200048600 1 . 3583.95 1 3 . 20080200048602 4309.63 18 1 100 6 34 1    0  50 99.99 .
      2008 63083 3 . 20071200078000 1 . 3296.39 1 2 . 20071200078002 3296.39 41 2 100 1 34 1    0 111 99.99 .
      2008 63412 3 . 20070200011300 1 . 1716.01 1 1 . 20070200011301 1716.01 45 1 100 1 10 2 7270 124 99.99 .
      2008 62895 3 . 20070100004400 1 . 3368.15 1 3 . 20070100004402 3368.15 25 2 200 6 10 2 5170  73 99.99 .
      2008 62810 3 . 20071200037500 1 . 1290.85 1 2 . 20071200037502 1290.85 52 2 200 1 10 2 7870  92 99.99 .
      2008 63290 3 . 20080300012400 1 . 4017.59 1 1 . 20080300012401 4017.59 24 2 200 6 10 2 8270  73 99.99 .
      2008 62492 3 .              0 1 . 1138.31 1 2 .              0 1218.39 53 2 200 5 32 1    0  73 99.99 .
      2008 62698 3 . 20070200049100 1 . 1493.36 1 2 . 20070200049102 1364.28 14 1 200 6  0 0    0   1 99.99 .
      2008 63032 3 .              0 1 . 1896.63 1 2 .              0 1896.63 34 2 100 1 10 2 8190  81 99.99 .
      2008 63088 3 . 20080100078300 1 . 2328.09 1 3 . 20080100078304 3104.62  4 1 200 6  0 0    0   1 99.99 .
      2008 63245 3 .              0 1 . 2399.19 1 3 .              0 1652.97 24 2 802 6 10 2 8680  81     0 .
      2008 62865 3 . 20061203931700 1 . 3937.04 1 1 . 20061203931701 3937.04 64 1 100 4 36 1    0  81 99.99 .
      2008 63114 3 .              0 1 . 1329.39 1 1 .              0 1329.39 49 2 200 4 10 2 1590 111 99.99 .
      2008 63392 3 . 20080100008000 1 . 1261.87 1 3 . 20080100008003 1218.14 19 2 200 6 34 1    0  60 99.99 .
      2008 62744 3 . 20080200080000 1 . 1220.55 1 1 . 20080200080001 1220.55 44 1 200 1 12 2 7770  73 99.99 .
      2008 63204 3 . 20080200015100 1 . 1713.16 1 5 . 20080200015105 1654.83 10 2 100 6  0 0    0   1 99.99 .
      2008 63323 3 . 20070300029500 1 . 1327.98 1 2 . 20070300029502  1918.2 18 1 200 6 34 1    0  50 99.99 .
      2008 63222 3 . 20070200013500 1 . 1997.15 1 2 . 20070200013503 2028.39 10 1 100 6  0 0    0   1 99.99 .
      2008 63453 3 . 20080300075000 1 . 2924.93 1 2 . 20080300075004 2953.66 13 2 100 6  0 0    0   1 99.99 .
      2008 62920 3 . 20070300030500 1 .  3075.6 1 1 . 20070300030502  3075.6 22 1 100 6 21 2 7070  73 99.99 .
      2008 62475 3 . 20070100042800 1 . 1113.47 1 2 . 20070100042802 1263.18 15 2 200 6 34 1    0  40 99.99 .
      2008 62789 3 .              0 1 . 1613.48 1 3 .              0 2021.21 13 2 100 6  0 0    0   1 99.99 .
      2008 63485 3 .              0 1 . 2361.97 1 1 .              0 2361.97 46 2 100 1 10 2 8190 111 99.99 .
      2008 62491 3 .              0 1 . 1354.45 1 5 .              0 1619.52 10 2 200 6  0 0    0   1 99.99 .
      2008 62389 3 . 20071200057200 1 .  2066.6 1 5 . 20071200057203 1589.02  4 1 100 6  0 0    0   1 99.99 .
      2008 62460 3 . 20080100063000 1 .  3296.4 1 3 . 20080100063003 5973.34 48 1 100 4 32 1    0  50 99.99 .
      2008 63426 3 .              0 1 . 1335.88 1 1 .              0 1335.88 55 2 200 4 10 2 8190  73 99.99 .
      2008 62526 3 . 20070200051000 1 . 1911.44 1 2 . 20070200051002 1911.44 42 2 100 1 10 2 8190 111 99.99 .
      2008 62765 3 .              0 1 .  2328.4 1 3 .              0 1491.12  7 1 100 6  0 0    0   1 99.99 .
      2008 62768 3 .              0 1 . 2294.39 1 3 .              0 2333.18  5 1 100 6  0 0    0   1 99.99 .
      2008 62821 3 . 20080100023300 1 . 1614.86 1 1 . 20080100023301 1614.86 39 1 100 1 10 2 7970 124 99.99 .
      2008 62782 3 . 20070300027000 1 . 3005.12 1 1 . 20070300027001 3005.12 35 1 100 1 10 2  770  73 99.99 .
      2008 62660 3 .              0 1 . 2174.12 1 4 .              0  1636.6  5 2 100 6  0 0    0   1 99.99 .
      2008 63395 3 . 20080200010200 1 . 3107.37 1 2 . 20080200010202 3107.37 59 2 100 1 36 1    0 111 99.99 .
      2008 62461 3 . 20080100044700 1 . 4458.26 1 4 . 20080100044702 4795.75 58 1 100 6 32 1    0   2 99.99 .
      2008 62647 3 . 20070300046500 1 . 1642.39 1 5 . 20070300046504 1702.72  9 2 100 6  0 0    0   1 99.99 .
      2008 63260 3 .              0 1 . 1247.34 1 1 .              0 1247.34 45 1 200 4 10 2 4470  73 99.99 .
      2008 62450 3 .              0 1 . 1193.19 1 2 .              0 1290.18 13 2 200 6  0 0    0   1 99.99 .
      2008 62578 3 . 20070300049400 1 . 3048.77 1 1 . 20070300049401 3048.77 73 2 100 3 36 1    0  73 99.99 .
      2008 63042 3 . 20080100016700 1 . 4020.34 1 5 . 20080100016705 4433.38 64 2 100 4 32 1    0  73 99.99 .
      2008 62768 3 .              0 1 . 2294.39 1 2 .              0 2294.39 22 1 100 1 10 2 3570  73 99.99 .
      2008 62572 3 . 20070200061600 1 . 3826.72 1 4 . 20070200061604 3643.16 14 2 100 6  0 0    0   1 99.99 .
      2008 62828 3 . 20080100038800 1 . 1458.18 1 1 . 20080100038801 1458.18 23 2 200 1 34 1    0  81 99.99 .
      2008 62921 3 . 20080300036200 1 . 1763.99 1 2 . 20080300036202 1763.99 28 1 200 1 10 2 5170  71 99.99 .
      2008 63386 3 . 20071200006000 1 . 1572.91 1 4 . 20071200006004  1468.2 16 2 200 6 34 1    0  40 99.99 .
      2008 63052 3 . 20061202670800 1 . 4205.08 1 2 . 20061202670802 4205.08 64 1 100 1 32 1    0  73 99.99 .
      2008 62576 3 . 20070300063100 1 . 1642.39 1 2 . 20070300063102 1642.39 41 2 100 1 10 2 5190 111 99.99 .
      2008 63110 3 . 20070300071000 1 . 2708.76 1 1 . 20070300071001 2708.76 48 2 100 4 32 1    0  92 99.99 .
      2008 62899 3 . 20070200034700 1 . 1765.81 1 2 . 20070200034702 1765.81 44 2 100 1 34 1    0 111 99.99 .
      2008 62675 3 . 20080200059300 1 . 1256.85 1 4 . 20080200059303 1450.65  9 1 200 6  0 0    0   1 99.99 .
      2008 62532 3 . 20070300057500 1 . 1563.09 1 1 . 20070300057501 1563.09 23 1 200 6 10 2 4690  73 99.99 .
      2008 63202 3 . 20080200000100 1 . 3050.83 1 1 . 20080200000101 3050.83 69 2 100 4 10 2 7390  81 99.99 .
      2008 62852 3 . 20080300031800 1 . 2850.17 1 1 . 20080300031801 2850.17 53 1 100 1 10 2 6990  92 99.99 .
      2008 62747 3 . 20080300076700 1 . 2609.96 1 2 . 20080300076702 2609.96 68 2 100 1 36 1    0  73 99.99 .
      2008 62882 3 . 20070100029800 1 . 1217.65 1 2 . 20070100029802 1217.65 58 1 200 1 10 2 9380 111 99.99 .
      2008 62647 3 . 20070300046500 1 . 1642.39 1 4 . 20070300046503 1702.72  9 2 100 6  0 0    0   1 99.99 .
      2008 62691 3 . 20070100057600 1 .  977.28 1 4 . 20070100057603 1245.95 37 2 200 6 32 1    0  73 99.99 .
      2008 62935 3 .              0 1 .  1409.7 1 1 .              0  1409.7 60 2 200 4 10 2 6870  73 99.99 .
      2008 63203 3 . 20080200015400 1 . 1832.25 1 2 . 20080200015402 1832.25 35 2 100 1 34 1    0 111 99.99 .
      2008 62870 3 . 20061206426200 1 . 2103.34 1 1 . 20061206426201 2103.34 54 2 100 4 10 2 8190 123 28.56 .
      2008 63180 3 . 20071200018400 1 . 1694.84 1 1 . 20071200018401 1694.84 44 1 100 1 10 2 7290 111 99.99 .
      2008 63009 3 . 20080300021200 1 . 2601.94 1 3 . 20080300021203 3358.67 21 2 100 6 34 1    0  81 99.99 .
      2008 63390 3 . 20080100007200 1 . 1556.16 1 1 . 20080100007201 1556.16 52 1 100 1 10 2 2980 111 99.99 .
      2008 63354 3 .              0 1 . 1963.25 1 3 .              0 2233.28  6 1 200 6  0 0    0   1 99.99 .
      2008 63076 3 . 20080300073800 1 . 2609.74 1 2 . 20080300073802 2609.74 66 2 100 1 34 1    0  73 99.99 .
      2008 62526 3 . 20070200051000 1 . 1911.44 1 3 . 20070200051003 2025.22  6 2 100 6  0 0    0   1 99.99 .
      2008 63137 3 . 20070200080300 1 . 3222.77 1 2 . 20070200080302 3222.77 59 2 100 1 10 2 8190  92 99.99 .
      2008 63009 3 . 20080300021200 1 . 2601.94 1 2 . 20080300021202 2601.94 50 2 100 1 34 1    0  73 99.99 .
      2008 62771 3 .              0 1 .  909.52 1 3 .              0 2227.99 43 1 200 6 10 2 2670  60 99.99 .
      2008 62728 3 . 20071200074200 1 . 2144.12 1 3 . 20071200074203 1844.16 22 1 200 6 21 2 7580  50 99.99 .
      2008 63256 3 .              0 1 . 1791.16 1 1 .              0 1791.16 61 1 100 1 10 2 7290 123 99.99 .
      2008 62819 3 . 20080100018600 1 . 3720.49 1 2 . 20080100018602 3720.49 61 2 100 1 36 1    0 111 99.99 .
      2008 63003 3 . 20071200016400 1 . 1585.88 1 2 . 20071200016402 1585.88 33 2 200 1 12 2 8190 124 99.99 .
      2008 63386 3 . 20071200006000 1 . 1572.91 1 1 . 20071200006001 1572.91 42 2 200 1 10 2 8680  73 99.99 .
      2008 63089 3 . 20080100069200 1 . 1075.18 1 3 . 20080100069204 1535.47 22 1 200 6 34 1    0  81 99.99 .
      2008 62631 3 . 20080100063300 1 .    3273 1 2 . 20080100063302    3273 23 2 100 1 34 1    0  73 99.99 .
      2008 63117 3 .              0 1 . 1806.05 1 1 .              0 1806.05 18 1 100 6 34 1    0  73 99.99 .
      2008 62853 3 . 20080300021600 1 . 2622.84 1 1 . 20080300021601 2622.84 49 1 100 1 10 2 9470   2 99.99 .
      2008 63139 3 .              0 1 . 1032.24 1 2 .              0 1032.24 73 2 200 1 10 2 8370  73 99.99 .
      2008 62490 3 .              0 1 . 1425.61 1 1 .              0 1425.61 80 1 200 4 32 1    0  20 99.99 .
      2008 63381 3 .              0 1 .  1897.5 1 4 .              0 1834.13  7 2 100 6  0 0    0   1 99.99 .
      2008 63203 3 . 20080200015400 1 . 1832.25 1 1 . 20080200015401 1832.25 45 1 100 1 10 2 6990  81 99.99 .
      2008 62726 3 . 20071200070300 1 . 1026.84 1 1 . 20071200070302 1026.84 77 2 200 5 36 1    0  10 99.99 .
      2008 63069 3 .              0 1 . 1989.91 1 2 .              0 1989.91 27 2 100 1 32 1    0  81 99.99 .
      2008 62445 3 .              0 1 . 1575.41 1 3 .              0 1499.38 15 2 200 6 34 1    0  71 99.99 .
      2008 62909 3 . 20070200014600 1 .  1567.6 1 1 . 20070200014601  1567.6 45 2 200 4 32 1    0  73 99.99 .
      2008 63410 3 . 20070100012600 1 . 2742.85 1 3 . 20070100012604 2860.58  8 2 200 6  0 0    0   1 99.99 .
      end
      label values month MONTH
      label def MONTH 3 "march", modify
      label values asecflag ASECFLAG
      label def ASECFLAG 1 "asec", modify
      label values hflag HFLAG
      label values statefip STATEFIP
      label def STATEFIP 1 "alabama", modify
      label values age AGE
      label def AGE 0 "under 1 year", modify
      label def AGE 4 "4", modify
      label def AGE 5 "5", modify
      label def AGE 6 "6", modify
      label def AGE 7 "7", modify
      label def AGE 8 "8", modify
      label def AGE 9 "9", modify
      label def AGE 10 "10", modify
      label def AGE 13 "13", modify
      label def AGE 14 "14", modify
      label def AGE 15 "15", modify
      label def AGE 16 "16", modify
      label def AGE 18 "18", modify
      label def AGE 19 "19", modify
      label def AGE 20 "20", modify
      label def AGE 21 "21", modify
      label def AGE 22 "22", modify
      label def AGE 23 "23", modify
      label def AGE 24 "24", modify
      label def AGE 25 "25", modify
      label def AGE 27 "27", modify
      label def AGE 28 "28", modify
      label def AGE 33 "33", modify
      label def AGE 34 "34", modify
      label def AGE 35 "35", modify
      label def AGE 37 "37", modify
      label def AGE 39 "39", modify
      label def AGE 41 "41", modify
      label def AGE 42 "42", modify
      label def AGE 43 "43", modify
      label def AGE 44 "44", modify
      label def AGE 45 "45", modify
      label def AGE 46 "46", modify
      label def AGE 48 "48", modify
      label def AGE 49 "49", modify
      label def AGE 50 "50", modify
      label def AGE 52 "52", modify
      label def AGE 53 "53", modify
      label def AGE 54 "54", modify
      label def AGE 55 "55", modify
      label def AGE 58 "58", modify
      label def AGE 59 "59", modify
      label def AGE 60 "60", modify
      label def AGE 61 "61", modify
      label def AGE 64 "64", modify
      label def AGE 66 "66", modify
      label def AGE 68 "68", modify
      label def AGE 69 "69", modify
      label def AGE 73 "73", modify
      label def AGE 77 "77", modify
      label def AGE 78 "78", modify
      label def AGE 80 "80", modify
      label values sex SEX
      label def SEX 1 "male", modify
      label def SEX 2 "female", modify
      label values race RACE
      label def RACE 100 "white", modify
      label def RACE 200 "black/negro", modify
      label def RACE 802 "white-american indian", modify
      label values marst MARST
      label def MARST 1 "married, spouse present", modify
      label def MARST 3 "separated", modify
      label def MARST 4 "divorced", modify
      label def MARST 5 "widowed", modify
      label def MARST 6 "never married/single", modify
      label values empstat EMPSTAT
      label def EMPSTAT 0 "niu", modify
      label def EMPSTAT 1 "armed forces", modify
      label def EMPSTAT 10 "at work", modify
      label def EMPSTAT 12 "has job, not at work last week", modify
      label def EMPSTAT 21 "unemployed, experienced worker", modify
      label def EMPSTAT 32 "nilf, unable to work", modify
      label def EMPSTAT 34 "nilf, other", modify
      label def EMPSTAT 36 "nilf, retired", modify
      label values labforce LABFORCE
      label def LABFORCE 0 "niu", modify
      label def LABFORCE 1 "no, not in the labor force", modify
      label def LABFORCE 2 "yes, in the labor force", modify
      label values educ EDUC
      label def EDUC 1 "niu or blank", modify
      label def EDUC 2 "none or preschool", modify
      label def EDUC 10 "grades 1, 2, 3, or 4", modify
      label def EDUC 20 "grades 5 or 6", modify
      label def EDUC 30 "grades 7 or 8", modify
      label def EDUC 40 "grade 9", modify
      label def EDUC 50 "grade 10", modify
      label def EDUC 60 "grade 11", modify
      label def EDUC 71 "12th grade, no diploma", modify
      label def EDUC 73 "high school diploma or equivalent", modify
      label def EDUC 81 "some college but no degree", modify
      label def EDUC 91 "associate's degree, occupational/vocational program", modify
      label def EDUC 92 "associate's degree, academic program", modify
      label def EDUC 111 "bachelor's degree", modify
      label def EDUC 123 "master's degree", modify
      label def EDUC 124 "professional school degree", modify
      ------------------ copy up to and including the previous line ------------------

      Listed 100 out of 4166259 observations
      Use the count() option to list more

      .

      Comment


      • #4
        Clyde, I failed to run the help function for dataex before posting, which may answer whether my response was appropriate. I will look at that now.

        Comment


        • #5
          Hopefully this is more appropriate!
          . dataex educ

          ----------------------- copy starting from the next line -----------------------
          Code:
          * Example generated by -dataex-. To install: ssc install dataex
          clear
          input int educ
           73
           81
           81
           81
           20
           73
            1
           30
           40
           40
           91
           73
           73
           50
          111
          124
           73
           92
           73
           73
            1
           81
            1
           81
           81
          111
           60
           73
            1
           50
            1
            1
           73
           40
            1
          111
            1
            1
           50
           73
          111
            1
            1
          124
           73
            1
          111
            2
            1
           73
            1
           73
           73
           73
            1
           81
           71
           40
           73
          111
           92
          111
            1
           73
           81
           92
           73
          111
            1
           73
           73
          111
          123
          111
           81
          111
            1
           73
            1
           92
           73
           60
           50
          123
          111
          124
           73
           81
           73
           73
            2
           73
           20
            1
           81
           10
           81
           71
           73
            1
          end
          label values educ EDUC
          label def EDUC 1 "niu or blank", modify
          label def EDUC 2 "none or preschool", modify
          label def EDUC 10 "grades 1, 2, 3, or 4", modify
          label def EDUC 20 "grades 5 or 6", modify
          label def EDUC 30 "grades 7 or 8", modify
          label def EDUC 40 "grade 9", modify
          label def EDUC 50 "grade 10", modify
          label def EDUC 60 "grade 11", modify
          label def EDUC 71 "12th grade, no diploma", modify
          label def EDUC 73 "high school diploma or equivalent", modify
          label def EDUC 81 "some college but no degree", modify
          label def EDUC 91 "associate's degree, occupational/vocational program", modify
          label def EDUC 92 "associate's degree, academic program", modify
          label def EDUC 111 "bachelor's degree", modify
          label def EDUC 123 "master's degree", modify
          label def EDUC 124 "professional school degree", modify
          ------------------ copy up to and including the previous line ------------------

          Listed 100 out of 4166259 observations
          Use the count() option to list more

          Comment


          • #6
            Of course I instead posted for education instead of employment status, which is what my question concerns. I will post the one for employment now. (sorry, school has got me going crazy )

            . dataex empstat

            ----------------------- copy starting from the next line -----------------------
            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input byte empstat
            10
            34
             1
            10
            36
            10
             0
            34
            34
            34
            32
            36
            36
            34
            34
            10
            10
            10
            10
            32
             0
            10
             0
            10
            36
            10
            34
            12
             0
            34
             0
             0
            21
            34
             0
            10
             0
             0
            32
            10
            10
             0
             0
            10
            10
             0
            36
            32
             0
            10
             0
            36
            32
            10
             0
            34
            10
            34
            32
            10
            32
            34
             0
            10
            10
            10
            36
            10
             0
            32
            10
            34
            10
            10
            34
            10
             0
            34
             0
            10
            34
            10
            21
            10
            36
            12
            10
            34
            34
            34
            10
            10
            32
             0
            10
            36
            32
            34
            32
             0
            end
            label values empstat EMPSTAT
            label def EMPSTAT 0 "niu", modify
            label def EMPSTAT 1 "armed forces", modify
            label def EMPSTAT 10 "at work", modify
            label def EMPSTAT 12 "has job, not at work last week", modify
            label def EMPSTAT 21 "unemployed, experienced worker", modify
            label def EMPSTAT 32 "nilf, unable to work", modify
            label def EMPSTAT 34 "nilf, other", modify
            label def EMPSTAT 36 "nilf, retired", modify
            ------------------ copy up to and including the previous line ------------------

            Comment


            • #7
              This is probably what you want:
              Code:
              label list EMPSTAT
              
              recode empstat (1 10 12 = 1) (0 = .n) (nonmissing = 0) , gen(empstat2)
              label define empstat2    1    "Employed"    0    "Not Employed" .n "Not in Universe"
              label values empstat2 empstat2
              
              //    SHOW THE RESULTS
              tab empstat empstat2, miss
              This creates a new variable, empstat2, that has two non-missing categories, corresponding to having a job and not having a job. The niu category, which I take it means "not in universe" is a bit of a challenge. I decided to code it as one of Stata's extended missing values, .n. This means that in calculations Stata will treat it as missing, but if you want to display it, it can still be labelled as "Not in Universe." I was also not entirely sure which way to classify "has job, noat at work last week," but decided to consider it an employed category. If these decisions are not appropriate for the way you will be using your data, I think you can see how to modify the -recode- command to suit your needs.

              Comment


              • #8
                Clyde, thank you so much for the response and help! I will take a look and see if this works for me. How you classified "has job, not at work last week" is how I would classify it as well so that should work!

                Comment

                Working...
                X