We’ve begun making our detailed plans for the 2012 CMGPD-LN Summer Course at Shanghai Jiaotong University. The Chinese-language announcement is available at our SJTU Center website, via this link: http://ishnc.sjtu.edu.cn//do/bencandy.php?fid=43&id=637. It will be July 6 to July 20. Since there may be non-Chinese speaking participants this year, I will probably lecture in English. The goal of the course is to introduce participants to management and analysis of the CMGPD-LN data, with special attention to using STATA to transform the data and create new variables as needed for different analyses.
[This is another note on using the SDA interface to analyze IPUMS that is intended for students in my Introduction to Social Demography. I am posting it here rather than my class website because it may be of interest to others who are using the IPUMS for teaching.]
The ACS includes some very useful questions on demographic events within the last year, including births, marriages, and divorces within the last year. Many students have indicated an interest in studying birth rates, so I am writing this note to provide some help on using the ACS data from 2001 to the present to calculate basic rates.
The ACS data on IPUMS includes a variable that indicates whether someone has had a birth in the last year. It is 0 for cases where the information is not available, 1 if no birth occurred, and 2 if a birth occurred. We can use this to approximate fertility rates if we restrict (using the filter) to observations where fertyr was 1 or 2, use comparison of means, and remember to subtract 1 from the means that appear in the table. We need to subtract because 1 indicates no births, while 2 indicates a birth.
To calculate age-specific rates by year from 2001 to 2009, I set up a calculation with the following…
Dependent variable: fertyr
Selection filter: fertyr(1-2) sex(2) age(10-49)
Also, under ‘Change number of decimal places to display’, I selected 3, so that whatever the mean was, subtracting 1 and multiplying by 1000 would yield a rate per thousand.
To address the problem associated with fertyr being 1 for people who haven’t had a birth, and 2 for people who have had a birth, we could recode fertyr so that 0 means no births, and 1 means a birth. In that case, the mean would actually be the proportion of people who have had a birth:
Dependent variable: feryr(0=1;1=2).
Of course, instead of using year as the column variable, one could use race, or some other variable of interest.
Just remember that what is reported in each cell of the output is the mean number of children in the last year plus one, so that when you prepare tables to turn in, you subtract one from each of the values in the cells in the output.
[Another note intended for students in my Introduction to Social Demography class who are using IPUMS-USA for their final projects, but which may be of interest to others using IPUMS in their courses]
Many students have expressed interest in examining time trends in average age at marriage, total number of children, completed education, and other phenomena that are fixed relatively early in life. Looking at these numbers by Census year (i.e. by making year a row or column variable) is plausible, but doing so mixes together people who came of age in various eras, unless there is some carefully restriction on the ages of the people.
For example, looking at total number of children born for women in a single Census mixes together relatively young people who went through their childbearing recently, when birth rates were low, and people who went through childbearing earlier, when birth rates were high. This makes comparison across Census years problematic. Similar problems exist for average age at marriage, and so forth. One approach is to use a filter to limit the women included in a comparison to a narrow age range which is easy to compare across census.
Another approach, however, is to use a recoded variable for year of birth as a row or column variable, and thereby compare men or women according to the era in which they were born. This is fairly straightforward.
As an example, to look at trends in average age at marriage in successive birth cohort, I set up a comparison of means calculation. The dependent variable to agemarr, the row variable to birthyr(r:1890-1899;1900-1909;1910-1919;1920-1929;1930-1939;1940-1949), the column variable to sex, and the filter to agemarr(1-99) age(40-50) birthyr(1890-1940). I restricted to age 40-50 so that the calculation would only include people who had an opportunity to marry. Birthyr is limited to 1940 because agemarr is available only through 1980. The result was the following:
If I wanted to do this by race, I could have set the column variable to race, and the control variable to sex.
If I wanted graph of the average ages for people born in individual years, I can specify the row variable as birthyr but with no recode, and then down below check ‘Suppress table’ (since it will have 50 rows, one for each year) and then under ‘Type of chart’ choose line chart. The result is the following:
Of course, you could just as easily do this by race, or education, or something else.
As another example, I redid the calculation to look at mean number of children ever born (chborn). I set the dependent variable to chborn, the row to birthyr(r:1850-1859;1860-1869;1870-1879;1880-1889;1890-1899;1900-1909;1910-1919;1920-1929;1930-1939;1940-1949), the filter to age(50-80) birthyr(1850-1940) chborn(1-*). The restriction of chborn to 1 and higher reflects the fact that chborn is 0 for people for whom the information is not available, and 1+the number of the children for everyone else. The filter for age being 50-80 restricts to women who are at least age 50, and have therefore completed their childbearing. Thus chborn being 1 means 0 children etc. In interpreting the results below, remember that the mean of chborn is one higher than the actual mean number of children. To get the mean number of children, you need to subtract one.
You may want to at least consider this approach for any outcome that is fixed relatively early in life, and may vary a lot according to the era in which someone grew up. Educational attainment would be another logical choice.
(I wrote this for the students in my undergraduate lecture course Introduction to Social Demography. They are working with IPUMS-USA for a final project. I thought it might be of more general interest to others who are using IPUMS-USA for each.)
We often want to calculate the proportion of people with some characteristic according to the values of two other variables. The characteristic of interest might be represented by a single value of a categorical variable, or one or more values of a categorical variable, or even a range of values in a continuous variable. We can do this with the ‘comparison of means’ tab that we use to compute the mean of income, socioeconomic index, or other continuous variables. We just have to recode the categorical variable that we are interested in into a dichotomous variable that is 1 if the person has the characteristic we are interested in, and 0 otherwise.
For example, we might want to calculate the proportion of people who have ever been married, according to year and age group. By ‘ever been married’, we mean anyone who is currently married, or was married in the past, but is now widowed, separated, or divorced. In the MARST variable for marital status, that would be anyone who had values 1-5. The remaining value, 6, corresponds to people who have never been married.
Of course, we could do a cross-tabulation in which our column variable was marital status, our row variable was age, and our control variable was year. We could add up the percentages of people in statuses 1-5 in the various tables. Of course, we could recode 1-5 into one category and have the computer do the addition for us, but we would still end up with a lot of output to go through.
Alternatively, we could recode marital status into a dichotomous variable that takes on the value of 0 or 1 according to whether someone has ever been married, and then compute the mean of that new variable for different combinations of year and age group. In the following example, I have set up a ‘comparison of means’ calculation in which the dependent variable is MARST recoded so that all values corresponding to categories where a person is currently married or was married in the past (MARST 1 through 5) are 1, and the never married are 0. The mean of this variable will be the proportion of people who are married, or were married in the past but are now widowed, separated, or divorced.
In the following, pay particular attention to the use of recode in the specification of the dependent variable to turn marst into a dichotomous variable:
Below is an example setting up a calculation to calculate proportions enrolled in school. School enrollment is originally coded so that 1 indicates that someone is not enrolled, and 2 indicates that they are enrolled. We recode to change 1 to a 0, and 2 to a 1, so that the mean ends up being the proportion currently enrolled. Note that for the school enrollment variable, it only makes sense to consider people who are at the right age to be enrolled in school.
Of course, you could do this with any number of other variables, including variables that were originally numeric or continuous. In the example below, I have transformed POVERTY so that it is 0 or 1 according to whether the household in which an individual lives is at or below the poverty line. POVERTY is originally coded as a three digit number that represents the household’s income as a percentage of the poverty line. 100 means that a household is at the poverty line, 001-099 means that a household is below the poverty line, and 101 up to 500 means that a household is above the poverty line. There are no values above 500 because POVERTY is top-coded: if a household is earning more than 500% of the poverty line, it is just set to 500. In the specification of the dependent variable, I have used the recode facility to change all values of poverty that are 101 or higher to 0, and all values of 001 to 100 to 1. The mean of the variable is therefore the proportion of people living in poverty. Note that the recode excludes 0 because 0 indicates that the value is not available.
The value in each cell represents the proportion of individuals of the specified race in each year who are in poverty.