---------------------------------------------------------------------

       log:  C:\AAA Miker Files\newer web pages\soc_meth_proj3\second

_class_2009.log

  log type:  text

 opened on:  29 Jan 2009, 11:05:21

 

. *On reading data in. First, unzip the compressed data file. Then, point Stata to the folder that all the files are in.

 

. cd "C:\AAA Miker Files\current class files\intro soc methods\1995 CPS"

C:\AAA Miker Files\current class files\intro soc methods\1995 CPS

 

*In order for stata to know where to find the dataset, we set the default directory to the folder the dataset is in, using the cd command and the entire path name of the folder in between double quotes.

 

 

. set mem 200m

 

Current memory allocation

 

                    current                                 memory usage

    settable          value     description                 (1M = 1024k)

    --------------------------------------------------------------------

    set maxvar         5000     max. variables allowed           1.909M

    set memory          200M    max. data space                200.000M

    set matsize         400     max. RHS vars in models          1.254M

                                                            -----------

                                                               203.163M

 

. memory

                                                  bytes

--------------------------------------------------------------------

Details of set memory usage

    overhead (pointers)                               0        0.00%

    data                                              0        0.00%

                                        ----------------------------

    data + overhead                                   0        0.00%

    free                                    209,715,192      100.00%

                                        ----------------------------

    Total allocated                         209,715,192      100.00%

--------------------------------------------------------------------

Other memory usage

    set maxvar usage                          2,001,730

    set matsize usage                         1,315,200

    programs, saved results, etc.                   188

                                        ---------------

    Total                                     3,317,118

-------------------------------------------------------

Grand total                                 213,032,310

 

. do "C:\AAA Miker Files\current class files\intro soc methods\1995 CPS\mrosenfe_ stanford_edu_004.do"

 

*first we uncompressed the data, then we set the default directory in stata to the folder that the dataset and the do file are in. Then we increased the memory to hold the dataset, then we used the file menu to call the do file in the appropriate folder.

 

. /* Important: you need to put the .dat and .do files in one folder/

>    directory and then set the working folder to that folder. */

.

. set more off

 

.

. clear

 

. infix ///

>  int     year                                 1-4 ///

>  float  hhwt                                 5-11 ///

>  float  perwt                               12-19 ///

>  int     relate                              20-23 ///

>  byte    age                                 24-25 ///

>  byte    sex                                 26 ///

>  int     race                                27-29 ///

>  byte    marst                               30 ///

>  byte    popstat                             31 ///

>  long    bpl                                 32-36 ///

>  byte    citizen                             37 ///

>  byte    educ99                              38-39 ///

>  long    inctot                              40-45 ///

>  using mrosenfe_stanford_edu_004.dat

(149642 observations read)

 

.

. replace hhwt=hhwt/100

(149642 real changes made)

 

. replace perwt=perwt/100

(149642 real changes made)

 

.

. label var year "Survey year"

 

. label var hhwt "Household weight"

 

. label var perwt "Person weight"

 

. label var relate "Relationship to household head"

 

. label var age "Age"

 

. label var sex "Sex"

 

. label var race "Race"

 

. label var marst "Marital status"

 

. label var popstat "Adult civilian, armed forces, or child"

 

. label var bpl "Birthplace"

 

. label var citizen "Citizenship status"

 

. label var educ99 "Educational attainment, 1990"

 

. label var inctot "Total personal income"

 

.

. label values year yearlbl

 

.

. label values hhwt hhwtlbl

 

.

. label values perwt perwtlbl

 

.

. label define relatelbl 0101 "Head/householder", add

 

. label define relatelbl 0201 "Spouse", add

 

. label define relatelbl 0301 "Child", add

 

. label define relatelbl 0303 "Stepchild", add

 

. label define relatelbl 0501 "Parent", add

 

. label define relatelbl 0701 "Sibling", add

 

. label define relatelbl 0901 "Grandchild", add

 

. label define relatelbl 1001 "Other relatives, n.s.", add

 

. label define relatelbl 1113 "Partner/roommate", add

 

. label define relatelbl 1114 "Unmarried partner", add

 

. label define relatelbl 1115 "Housemate/roomate", add

 

. label define relatelbl 1241 "Roomer/boarder/lodger", add

 

. label define relatelbl 1242 "Foster children", add

 

. label define relatelbl 1260 "Other nonrelatives", add

 

. label define relatelbl 9100 "Armed Forces, relationship unknown", add

 

 

. label define relatelbl 9200 "Age under 14, relationship unknown", add

 

. label define relatelbl 9900 "Relationship unknown", add

 

. label values relate relatelbl

 

.

. label define agelbl 00 "Under 1 year"

 

. label define agelbl 01 "1", add

 

. label define agelbl 02 "2", add

 

. label define agelbl 03 "3", add

 

. label define agelbl 04 "4", add

 

. label define agelbl 05 "5", add

 

. label define agelbl 06 "6", add

 

. label define agelbl 07 "7", add

 

. label define agelbl 08 "8", add

 

. label define agelbl 09 "9", add

 

. label define agelbl 10 "10", add

 

. label define agelbl 11 "11", add

 

. label define agelbl 12 "12", add

 

. label define agelbl 13 "13", add

 

. label define agelbl 14 "14", add

 

. label define agelbl 15 "15", add

 

. label define agelbl 16 "16", add

 

. label define agelbl 17 "17", add

 

. label define agelbl 18 "18", add

 

. label define agelbl 19 "19", add

 

. label define agelbl 20 "20", add

 

. label define agelbl 21 "21", add

 

. label define agelbl 22 "22", add

 

. label define agelbl 23 "23", add

 

. label define agelbl 24 "24", add

 

. label define agelbl 25 "25", add

 

. label define agelbl 26 "26", add

 

. label define agelbl 27 "27", add

 

. label define agelbl 28 "28", add

 

. label define agelbl 29 "29", add

 

. label define agelbl 30 "30", add

 

. label define agelbl 31 "31", add

 

. label define agelbl 32 "32", add

 

. label define agelbl 33 "33", add

 

. label define agelbl 34 "34", add

 

. label define agelbl 35 "35", add

 

. label define agelbl 36 "36", add

 

. label define agelbl 37 "37", add

 

. label define agelbl 38 "38", add

 

. label define agelbl 39 "39", add

 

. label define agelbl 40 "40", add

 

. label define agelbl 41 "41", add

 

. label define agelbl 42 "42", add

 

. label define agelbl 43 "43", add

 

. label define agelbl 44 "44", add

 

. label define agelbl 45 "45", add

 

. label define agelbl 46 "46", add

 

. label define agelbl 47 "47", add

 

. label define agelbl 48 "48", add

 

. label define agelbl 49 "49", add

 

. label define agelbl 50 "50", add

 

. label define agelbl 51 "51", add

 

. label define agelbl 52 "52", add

 

. label define agelbl 53 "53", add

 

. label define agelbl 54 "54", add

 

. label define agelbl 55 "55", add

 

. label define agelbl 56 "56", add

 

. label define agelbl 57 "57", add

 

. label define agelbl 58 "58", add

 

. label define agelbl 59 "59", add

 

. label define agelbl 60 "60", add

 

. label define agelbl 61 "61", add

 

. label define agelbl 62 "62", add

 

. label define agelbl 63 "63", add

 

. label define agelbl 64 "64", add

 

. label define agelbl 65 "65", add

 

. label define agelbl 66 "66", add

 

. label define agelbl 67 "67", add

 

. label define agelbl 68 "68", add

 

. label define agelbl 69 "69", add

 

. label define agelbl 70 "70", add

 

. label define agelbl 71 "71", add

 

. label define agelbl 72 "72", add

 

. label define agelbl 73 "73", add

 

. label define agelbl 74 "74", add

 

. label define agelbl 75 "75", add

 

. label define agelbl 76 "76", add

 

. label define agelbl 77 "77", add

 

. label define agelbl 78 "78", add

 

. label define agelbl 79 "79", add

 

. label define agelbl 80 "80", add

 

. label define agelbl 81 "81", add

 

. label define agelbl 82 "82", add

 

. label define agelbl 83 "83", add

 

. label define agelbl 84 "84", add

 

. label define agelbl 85 "85", add

 

. label define agelbl 86 "86", add

 

. label define agelbl 87 "87", add

 

. label define agelbl 88 "88", add

 

. label define agelbl 89 "89", add

 

. label define agelbl 90 "90 (90+, 1988-2002)", add

 

. label define agelbl 91 "91", add

 

. label define agelbl 92 "92", add

 

. label define agelbl 93 "93", add

 

. label define agelbl 94 "94", add

 

. label define agelbl 95 "95", add

 

. label define agelbl 96 "96", add

 

. label define agelbl 97 "97", add

 

. label define agelbl 98 "98", add

 

. label define agelbl 99 "99+", add

 

. label values age agelbl

 

.

. label define sexlbl 1 "Male"

 

. label define sexlbl 2 "Female", add

 

. label values sex sexlbl

 

.

. label define racelbl 100 "White", add

 

. label define racelbl 200 "Black/Negro", add

 

. label define racelbl 300 "American Indian/Aleut/Eskimo", add

 

. label define racelbl 650 "Asian or Pacific Islander", add

 

. label define racelbl 651 "Asian only", add

 

. label define racelbl 652 "Hawaiian/Pacific Islander only", add

 

. label define racelbl 700 "Other (single) race, n.e.c.", add

 

. label define racelbl 801 "White-Black", add

 

. label define racelbl 802 "White-American Indian", add

 

. label define racelbl 803 "White-Asian", add

 

. label define racelbl 804 "White-Hawaiian/Pacific Islander", add

 

. label define racelbl 805 "Black-American Indian", add

 

. label define racelbl 806 "Black-Asian", add

 

. label define racelbl 807 "Black-Hawaiian/Pacific Islander", add

 

. label define racelbl 808 "American Indian-Asian", add

 

. label define racelbl 809 "Asian-Hawaiian/Pacific Islander", add

 

. label define racelbl 810 "White-Black-American Indian", add

 

. label define racelbl 811 "White-Black-Asian", add

 

. label define racelbl 812 "White-American Indian-Asian", add

 

. label define racelbl 813 "White-Asian-Hawaiian/Pacific Islander", add

 

. label define racelbl 814 "White-Black-American Indian-Asian", add

 

. label define racelbl 820 "Two or three races, unspecified", add

 

. label define racelbl 830 "Four or five races, unspecified", add

 

. label values race racelbl

 

.

. label define marstlbl 1 "Married, spouse present"

 

. label define marstlbl 2 "Married, spouse absent", add

 

. label define marstlbl 3 "Separated", add

 

. label define marstlbl 4 "Divorced", add

 

. label define marstlbl 5 "Widowed", add

 

. label define marstlbl 6 "Never married/single", add

 

. label define marstlbl 9 "Unknown", add

 

. label values marst marstlbl

 

.

. label define popstatlbl 1 "Adult civilian"

 

. label define popstatlbl 2 "Armed Forces", add

 

. label define popstatlbl 3 "Child", add

 

. label values popstat popstatlbl

 

.

. label define bpllbl 09900 "United States, n.s.", add

 

. label define bpllbl 10000 "American Samoa", add

 

. label define bpllbl 10500 "Guam", add

 

. label define bpllbl 11000 "Puerto Rico", add

 

. label define bpllbl 11500 "U.S. Virgin Islands", add

 

 

. label define bpllbl 12090 "U.S. outlying areas, n.s.", add

 

. label define bpllbl 15000 "Canada", add

 

. label define bpllbl 16010 "Bermuda", add

 

. label define bpllbl 19900 "North America, n.s.", add

 

. label define bpllbl 20000 "Mexico", add

 

. label define bpllbl 21010 "Belize/British Honduras", add

 

. label define bpllbl 21020 "Costa Rica", add

 

. label define bpllbl 21030 "El Salvador", add

 

. label define bpllbl 21040 "Guatemala", add

 

. label define bpllbl 21050 "Honduras", add

 

. label define bpllbl 21060 "Nicaragua", add

 

. label define bpllbl 21070 "Panama", add

 

. label define bpllbl 21090 "Central America, n.s.", add

 

. label define bpllbl 25000 "Cuba", add

 

. label define bpllbl 26010 "Dominican Republic", add

 

. label define bpllbl 26020 "Haiti", add

 

. label define bpllbl 26030 "Jamaica", add

 

. label define bpllbl 26043 "Bahamas", add

 

. label define bpllbl 26044 "Barbados", add

 

. label define bpllbl 26054 "Dominica", add

 

. label define bpllbl 26055 "Grenada", add

 

. label define bpllbl 26060 "Trinidad and Tobago", add

 

. label define bpllbl 26065 "Antigua and Barbuda", add

 

. label define bpllbl 26070 "St. Kitts--Nevis", add

 

. label define bpllbl 26075 "St. Lucia", add

 

. label define bpllbl 26080 "St. Vincent and the Grenadi", add

 

. label define bpllbl 26091 "Caribbean, n.s.", add

 

. label define bpllbl 30005 "Argentina", add

 

. label define bpllbl 30010 "Bolivia", add

 

. label define bpllbl 30015 "Brazil", add

 

. label define bpllbl 30020 "Chile", add

 

. label define bpllbl 30025 "Colombia", add

 

. label define bpllbl 30030 "Ecuador", add

 

. label define bpllbl 30040 "Guyana/British Guiana", add

 

. label define bpllbl 30050 "Peru", add

 

. label define bpllbl 30060 "Uruguay", add

 

. label define bpllbl 30065 "Venezuela", add

 

. label define bpllbl 30070 "Paraguay", add

 

. label define bpllbl 30090 "South America, n.s.", add

 

. label define bpllbl 31000 "Americas, n.s.", add

 

. label define bpllbl 40000 "Denmark", add

 

. label define bpllbl 40100 "Finland", add

 

. label define bpllbl 40400 "Norway", add

 

. label define bpllbl 40500 "Sweden", add

 

. label define bpllbl 41000 "England", add

 

. label define bpllbl 41100 "Scotland", add

 

. label define bpllbl 41200 "Wales", add

 

. label define bpllbl 41300 "United Kingdom, n.s.", add

 

. label define bpllbl 41400 "Ireland", add

 

. label define bpllbl 41410 "Northern Ireland", add

 

. label define bpllbl 42000 "Belgium", add

 

. label define bpllbl 42100 "France", add

 

. label define bpllbl 42500 "Netherlands", add

 

. label define bpllbl 42600 "Switzerland", add

 

. label define bpllbl 43300 "Greece", add

 

. label define bpllbl 43400 "Italy", add

 

. label define bpllbl 43600 "Portugal", add

 

. label define bpllbl 43610 "Azores", add

 

. label define bpllbl 43800 "Spain", add

 

. label define bpllbl 45000 "Austria", add

 

. label define bpllbl 45200 "Czechoslavakia", add

 

. label define bpllbl 45212 "Slovakia", add

 

. label define bpllbl 45213 "Czech Republic", add

 

. label define bpllbl 45300 "Germany", add

 

. label define bpllbl 45400 "Hungary", add

 

. label define bpllbl 45500 "Poland", add

 

. label define bpllbl 45600 "Romania", add

 

. label define bpllbl 45650 "Bulgaria", add

 

. label define bpllbl 45700 "Yugoslavia", add

 

. label define bpllbl 45710 "Albania", add

 

. label define bpllbl 45720 "Bosnia and Herzegovina", add

 

. label define bpllbl 45730 "Croatia", add

 

. label define bpllbl 45740 "Macedonia", add

 

. label define bpllbl 45750 "Serbia", add

 

. label define bpllbl 45760 "Kosovo", add

 

. label define bpllbl 46100 "Latvia", add

 

. label define bpllbl 46200 "Lithuania", add

 

. label define bpllbl 46500 "Other USSR/Russia", add

 

. label define bpllbl 46530 "Ukraine", add

 

. label define bpllbl 46535 "Belarus", add

 

. label define bpllbl 46540 "Moldova", add

 

. label define bpllbl 46590 "USSR, n.s.", add

 

. label define bpllbl 49900 "Europe, n.s.", add

 

. label define bpllbl 50000 "China", add

 

. label define bpllbl 50010 "Hong Kong", add

 

. label define bpllbl 50040 "Taiwan", add

 

. label define bpllbl 50100 "Japan", add

 

. label define bpllbl 50200 "Korea", add

 

. label define bpllbl 50220 "South Korea", add

 

. label define bpllbl 51100 "Cambodia", add

 

. label define bpllbl 51200 "Indonesia", add

 

. label define bpllbl 51300 "Laos", add

 

. label define bpllbl 51400 "Malaysia", add

 

. label define bpllbl 51500 "Philippines", add

 

. label define bpllbl 51600 "Singapore", add

 

. label define bpllbl 51700 "Thailand", add

 

. label define bpllbl 51800 "Vietnam", add

 

. label define bpllbl 52000 "Afghanistan", add

 

. label define bpllbl 52100 "India", add

 

. label define bpllbl 52110 "Bangladesh", add

 

. label define bpllbl 52130 "Burma", add

 

. label define bpllbl 52140 "Pakistan", add

 

. label define bpllbl 52150 "Sri Lanka", add

 

. label define bpllbl 52200 "Nepal", add

 

. label define bpllbl 53000 "Iran", add

 

. label define bpllbl 53200 "Iraq", add

 

. label define bpllbl 53400 "Israel/Palestine", add

 

. label define bpllbl 53420 "Palestine", add

 

. label define bpllbl 53500 "Jordan", add

 

. label define bpllbl 53700 "Lebanon", add

 

. label define bpllbl 54000 "Saudi Arabia", add

 

. label define bpllbl 54100 "Syria", add

 

. label define bpllbl 54200 "Turkey", add

 

. label define bpllbl 54300 "Cyprus", add

 

. label define bpllbl 54350 "Kuwait", add

 

. label define bpllbl 54400 "Yemen", add

 

. label define bpllbl 54700 "Middle East, n.s.", add

 

. label define bpllbl 55100 "Armenia", add

 

. label define bpllbl 55200 "Azerbaijan", add

 

. label define bpllbl 55300 "Georgia", add

 

. label define bpllbl 55400 "Uzbekistan", add

 

. label define bpllbl 59900 "Asia, n.e.c./n.s.", add

 

. label define bpllbl 60010 "Northern Africa", add

 

. label define bpllbl 60012 "Egypt/United Arab Rep.", add

 

. label define bpllbl 60014 "Morocco", add

 

. label define bpllbl 60016 "Algeria", add

 

. label define bpllbl 60018 "Sudan", add

 

. label define bpllbl 60023 "Ghana", add

 

. label define bpllbl 60031 "Nigeria", add

 

. label define bpllbl 60032 "Cameroon", add

 

. label define bpllbl 60033 "Cape Verde", add

 

. label define bpllbl 60034 "Liberia", add

 

. label define bpllbl 60035 "Sengal", add

 

. label define bpllbl 60036 "Sierra Leone", add

 

. label define bpllbl 60040 "Eritrea", add

 

. label define bpllbl 60044 "Ethiopia", add

 

. label define bpllbl 60045 "Kenya", add

 

. label define bpllbl 60050 "Somalia", add

 

. label define bpllbl 60060 "Tanzania", add

 

. label define bpllbl 60065 "Uganda", add

 

. label define bpllbl 60070 "Zimbabwe", add

 

. label define bpllbl 60094 "South Africa (Union of)", add

 

. label define bpllbl 60099 "Africa, n.s./n.e.c.", add

 

. label define bpllbl 70010 "Australia", add

 

. label define bpllbl 70020 "New Zealand", add

 

. label define bpllbl 71000 "Pacific Islands", add

 

. label define bpllbl 71021 "Fiji", add

 

. label define bpllbl 71022 "Tonga", add

 

. label define bpllbl 96000 "Other, n.e.c. and unknown", add

 

. label values bpl bpllbl

 

.

. label define citizenlbl 0 "NIU"

 

. label define citizenlbl 1 "Born abroad of American parents", add

 

. label define citizenlbl 2 "Naturalized citizen", add

 

. label define citizenlbl 3 "Not a citizen", add

 

. label values citizen citizenlbl

 

.

. label define educ99lbl 00 "NIU"

 

. label define educ99lbl 01 "No school completed", add

 

. label define educ99lbl 04 "1st-4th grade", add

 

. label define educ99lbl 05 "5th-8th grade", add

 

. label define educ99lbl 06 "9th grade", add

 

. label define educ99lbl 07 "10th grade", add

 

. label define educ99lbl 08 "11th grade", add

 

. label define educ99lbl 09 "12th grade, no diploma", add

 

. label define educ99lbl 10 "High school graduate, or GED", add

 

. label define educ99lbl 11 "Some college, no degree", add

 

. label define educ99lbl 12 "Associate degree, occupational program", add

 

. label define educ99lbl 13 "Associate degree, academic program", add

 

. label define educ99lbl 14 "Bachelors degree", add

 

. label define educ99lbl 15 "Masters degree", add

 

. label define educ99lbl 16 "Professional degree", add

 

. label define educ99lbl 17 "Doctorate degree", add

 

. label values educ99 educ99lbl

 

.

. label values inctot inctotlbl

 

.

.

end of do-file

 

. *At this point, we would want to save the data.

 

. save "C:\AAA Miker Files\current class files\intro soc methods\1995 CPS\1995_cps_individuals.dta"

 

*Saving, like opening a log or calling a do file is best done via the menus, so you don’t have to type the whole file name.

 

 

file C:\AAA Miker Files\current class files\intro soc methods\1995 CPS\1995_cps_individuals.dta saved

 

. clear

 

. use "C:\AAA Miker Files\newer web pages\soc_meth_proj3\cps_mar_2000_new.dta", clear

 

*Back to the March, 2000 CPS data we have been working with.

 

 

. tabulate race

 

                                 Race |      Freq.     Percent        Cum.

--------------------------------------+-----------------------------------

                                White |    113,475       84.87       84.87

                          Black/Negro |     13,626       10.19       95.06

         American Indian/Aleut/Eskimo |      1,894        1.42       96.47

            Asian or Pacific Islander |      4,715        3.53      100.00

--------------------------------------+-----------------------------------

                                Total |    133,710      100.00

 

. tabulate race, nolabel

 

       Race |      Freq.     Percent        Cum.

------------+-----------------------------------

        100 |    113,475       84.87       84.87

        200 |     13,626       10.19       95.06

        300 |      1,894        1.42       96.47

        650 |      4,715        3.53      100.00

------------+-----------------------------------

      Total |    133,710      100.00

 

. summarize race

 

    Variable |       Obs        Mean    Std. Dev.       Min        Max

-------------+--------------------------------------------------------

        race |    133710    132.4183    105.8387        100        650

 

. *Don't summarize race, it's a nominal rather than real numerical value. The tricky thing about computer software, especially data analysis software, is that it will let you do lots of things that don’t make sense. It is your job to know that race, while stored as a number, is a nominal variable rather than a real and meaningful number. The average of race doesn’t mean anything!

 

. tabulate educrec

 

 Educational attainment |

                 recode |      Freq.     Percent        Cum.

------------------------+-----------------------------------

                    NIU |     30,484       22.80       22.80

      None or preschool |        457        0.34       23.14

   Grades 1, 2, 3, or 4 |      1,187        0.89       24.03

   Grades 5, 6, 7, or 8 |      6,847        5.12       29.15

                Grade 9 |      4,161        3.11       32.26

               Grade 10 |      4,695        3.51       35.77

               Grade 11 |      4,721        3.53       39.30

               Grade 12 |     33,461       25.03       64.33

1 to 3 years of college |     25,883       19.36       83.69

    4+ years of college |     21,814       16.31      100.00

------------------------+-----------------------------------

                  Total |    133,710      100.00

 

. tabulate educrec, nolabel

 

Educational |

 attainment |

     recode |      Freq.     Percent        Cum.

------------+-----------------------------------

          0 |     30,484       22.80       22.80

          1 |        457        0.34       23.14

          2 |      1,187        0.89       24.03

          3 |      6,847        5.12       29.15

          4 |      4,161        3.11       32.26

          5 |      4,695        3.51       35.77

          6 |      4,721        3.53       39.30

          7 |     33,461       25.03       64.33

          8 |     25,883       19.36       83.69

          9 |     21,814       16.31      100.00

------------+-----------------------------------

      Total |    133,710      100.00

 

. *Even though educational values are ordinal, the numbers don't make sense. The intervals are not constant. The units are wrong.

 

. table educrec, contents(mean yrsed)

 

-------------------------------------

Educational attainment  |

recode                  | mean(yrsed)

------------------------+------------

                    NIU |           

      None or preschool |           0

   Grades 1, 2, 3, or 4 |         2.5

   Grades 5, 6, 7, or 8 |         6.5

                Grade 9 |           9

               Grade 10 |          10

               Grade 11 |          11

               Grade 12 |          12

1 to 3 years of college |          14

    4+ years of college |          17

-------------------------------------

 

. summarize yrsed

 

    Variable |       Obs        Mean    Std. Dev.       Min        Max

-------------+--------------------------------------------------------

       yrsed |    103226    12.77328    3.156011          0         17

 

. summarize yrsed if age >30 & age<50 [fweight= perwt_rounded], detail

 

                      based on educrec

-------------------------------------------------------------

      Percentiles      Smallest

 1%          2.5              0

 5%            9              0

10%           11              0       Obs            80180249

25%           12              0       Sum of Wgt.    80180249

 

50%           14                      Mean            13.5899

                        Largest       Std. Dev.      2.820979

75%           17             17

90%           17             17       Variance       7.957925

95%           17             17       Skewness      -.9947305

99%           17             17       Kurtosis       5.701668

 

. summarize yrsed if age >50 & age<70 [fweight= perwt_rounded], detail

 

                      based on educrec

-------------------------------------------------------------

      Percentiles      Smallest

 1%          2.5              0

 5%          6.5              0

10%            9              0       Obs            45868085

25%           12              0       Sum of Wgt.    45868085

 

50%           12                      Mean           12.98228

                        Largest       Std. Dev.      3.199903

75%           14             17

90%           17             17       Variance       10.23938

95%           17             17       Skewness      -.9344749

99%           17             17       Kurtosis       4.709135

 

. table race sex , contents(mean  perwt_rounded mean yrsed mean  incwage freq) row col

 

--------------------------------------------------------------------

                             |                  Sex                

                        Race |        Male       Female        Total

-----------------------------+--------------------------------------

                       White |    1994.989     1967.852     1981.114

                             |    12.83993     12.78335     12.81067

                             | 26757.33786  13475.26365  19887.90092

                             |      55,457       58,018      113,475

                             |

                 Black/Negro |    2698.307     2530.086     2605.949

                             |    12.17608     12.44003     12.32498

                             |  18662.4484   13607.1793  15810.57513

                             |       6,145        7,481       13,626

                             |

American Indian/Aleut/Eskimo |    1501.811     1504.968     1503.418

                             |    11.76947     12.06842     11.92008

                             | 16607.38626  10783.65564  13673.46136

                             |         930          964        1,894

                             |

   Asian or Pacific Islander |     2354.62     2282.427     2317.015

                             |    13.66059     13.15508     13.39401

                             | 27615.99537  15415.26867  21181.91411

                             |       2,259        2,456        4,715

                             |

                       Total |    2067.154     2033.617     2049.868

                             |    12.79632     12.75218     12.77328

                             | 25943.79926   13525.1652  19462.59227

                             |      64,791       68,919      133,710

--------------------------------------------------------------------

 

. *Table is a command that lets you put any kind of statistic (specified in the contents) into a table. There is a big variation in personal weight by race, not much variation by gender.

 

. tabulate race

 

                                 Race |      Freq.     Percent        Cum.

--------------------------------------+-----------------------------------

                                White |    113,475       84.87       84.87

                          Black/Negro |     13,626       10.19       95.06

         American Indian/Aleut/Eskimo |      1,894        1.42       96.47

            Asian or Pacific Islander |      4,715        3.53      100.00

--------------------------------------+-----------------------------------

                                Total |    133,710      100.00

 

. tabulate hispan

 

              Hispanic origin |      Freq.     Percent        Cum.

------------------------------+-----------------------------------

                 Not Hispanic |    108,641       81.25       81.25

             Mexican American |      6,447        4.82       86.07

              Chicano/Chicana |        384        0.29       86.36

           Mexican (Mexicano) |      8,155        6.10       92.46

                 Puerto Rican |      2,280        1.71       94.16

                        Cuban |        943        0.71       94.87

                Other Spanish |      1,863        1.39       96.26

       Central/South American |      3,487        2.61       98.87

                  Do not know |        471        0.35       99.22

N/A (and no response 1985-87) |      1,039        0.78      100.00

------------------------------+-----------------------------------

                        Total |    133,710      100.00

 

. * What if we want a variable that combines race and hispanicity?

 

. tabulate race, nolab

 

       Race |      Freq.     Percent        Cum.

------------+-----------------------------------

        100 |    113,475       84.87       84.87

        200 |     13,626       10.19       95.06

        300 |      1,894        1.42       96.47

        650 |      4,715        3.53      100.00

------------+-----------------------------------

      Total |    133,710      100.00

 

. tabulate hispan, nolab

 

   Hispanic |

     origin |      Freq.     Percent        Cum.

------------+-----------------------------------

          0 |    108,641       81.25       81.25

        102 |      6,447        4.82       86.07

        104 |        384        0.29       86.36

        108 |      8,155        6.10       92.46

        200 |      2,280        1.71       94.16

        300 |        943        0.71       94.87

        400 |      1,863        1.39       96.26

        410 |      3,487        2.61       98.87

        901 |        471        0.35       99.22

        902 |      1,039        0.78      100.00

------------+-----------------------------------

      Total |    133,710      100.00

 

. generate new_race=1 if race==100

(20235 missing values generated)

 

. replace new_race=2 if race==200

(13626 real changes made)

 

. replace new_race=3 if race==300

(1894 real changes made)

 

. replace new_race=4 if race==650

(4715 real changes made)

 

. replace new_race=5 if hispan>0 & hispan<901

(23559 real changes made)

 

. label define new_race_lbl 1 "NH white" 2 "NH black" 3 "NH Native Amer" 4 "NH Asian" 5 "Hispanic"

 

. label val new_race new_race_lbl

 

. tabulate race new_race

 

                      |                  new_race

                 Race |  NH white   NH black  NH Native   NH Asian |     Total

----------------------+--------------------------------------------+----------

                White |    90,988          0          0          0 |   113,475

          Black/Negro |         0     12,930          0          0 |    13,626

American Indian/Aleut |         0          0      1,649          0 |     1,894

Asian or Pacific Isla |         0          0          0      4,584 |     4,715

----------------------+--------------------------------------------+----------

                Total |    90,988     12,930      1,649      4,584 |   133,710

 

 

                      |  new_race

                 Race |  Hispanic |     Total

----------------------+-----------+----------

                White |    22,487 |   113,475

          Black/Negro |       696 |    13,626

American Indian/Aleut |       245 |     1,894

Asian or Pacific Isla |       131 |     4,715

----------------------+-----------+----------

                Total |    23,559 |   133,710

 

 

. tabulate race new_race, missing

 

                      |                  new_race

                 Race |  NH white   NH black  NH Native   NH Asian |     Total

----------------------+--------------------------------------------+----------

                White |    90,988          0          0          0 |   113,475

          Black/Negro |         0     12,930          0          0 |    13,626

American Indian/Aleut |         0          0      1,649          0 |     1,894

Asian or Pacific Isla |         0          0          0      4,584 |     4,715

----------------------+--------------------------------------------+----------

                Total |    90,988     12,930      1,649      4,584 |   133,710

 

 

                      |  new_race

                 Race |  Hispanic |     Total

----------------------+-----------+----------

                White |    22,487 |   113,475

          Black/Negro |       696 |    13,626

American Indian/Aleut |       245 |     1,894

Asian or Pacific Isla |       131 |     4,715

----------------------+-----------+----------

                Total |    23,559 |   133,710

 

 

. tabulate race new_race [fweight= perwt_rounded] row col

invalid 'row'

r(198);

 

. tabulate race new_race [fweight= perwt_rounded], row col

 

+-------------------+

| Key               |

|-------------------|

|     frequency     |

|  row percentage   |

| column percentage |

+-------------------+

 

                      |                  new_race

                 Race |  NH white   NH black  NH Native   NH Asian |     Total

----------------------+--------------------------------------------+----------

                White | 193633902          0          0          0 | 224806952

                      |     86.13       0.00       0.00       0.00 |    100.00

                      |    100.00       0.00       0.00       0.00 |     82.02

----------------------+--------------------------------------------+----------

          Black/Negro |         0 34,441,423          0          0 |35,508,668

                      |      0.00      96.99       0.00       0.00 |    100.00

                      |      0.00     100.00       0.00       0.00 |     12.96

----------------------+--------------------------------------------+----------

American Indian/Aleut |         0          0  2,472,449          0 | 2,847,473

                      |      0.00       0.00      86.83       0.00 |    100.00

                      |      0.00       0.00     100.00       0.00 |      1.04

----------------------+--------------------------------------------+----------

Asian or Pacific Isla |         0          0          0 10,736,030 |10,924,728

                      |      0.00       0.00       0.00      98.27 |    100.00

                      |      0.00       0.00       0.00     100.00 |      3.99

----------------------+--------------------------------------------+----------

                Total | 193633902 34,441,423  2,472,449 10,736,030 | 274087821

                      |     70.65      12.57       0.90       3.92 |    100.00

                      |    100.00     100.00     100.00     100.00 |    100.00

 

 

                      |  new_race

                 Race |  Hispanic |     Total

----------------------+-----------+----------

                White |31,173,050 | 224806952

                      |     13.87 |    100.00

                      |     95.03 |     82.02

----------------------+-----------+----------

          Black/Negro | 1,067,245 |35,508,668

                      |      3.01 |    100.00

                      |      3.25 |     12.96

----------------------+-----------+----------

American Indian/Aleut |   375,024 | 2,847,473

                      |     13.17 |    100.00

                      |      1.14 |      1.04

----------------------+-----------+----------

Asian or Pacific Isla |   188,698 |10,924,728

                      |      1.73 |    100.00

                      |      0.58 |      3.99

----------------------+-----------+----------

                Total |32,804,017 | 274087821

                      |     11.97 |    100.00

                      |    100.00 |    100.00

 

 

. display 31173050/224806952

.13866586

 

*Be clear about how the column percentages and row percentages mean different things. display is a function that acts like a hand calculator. It will print the result of any expression.

 

. save "C:\AAA Miker Files\newer web pages\soc_meth_proj3\cps_mar_2000_new.dta",replace

file C:\AAA Miker Files\newer web pages\soc_meth_proj3\cps_mar_2000_new.dta saved

 

. exit, clear