Progam Library
Program Library
These programs have been provided to help you get started with the HILDA data and can be downloaded.
Provided by the HILDA team
Match files
The programs showing how to match files are:
- Program 1 SAS program to match wave 1 household and responding person files
- Program 2 SPSS program to match wave 1 household and responding person files
- Program 3 Stata program to match wave 1 household, enumerated and responding person files
Add Partner Variables
Some users may want to include variables for a respondent’s partner in their analyses. The programs showing how to utilise the partner’s crosswave identifier _hhpxid to add partner variables onto the responding person file are:
- Program 4 SAS program to add partner variables
- Program 5 SPSS program to add partner variables
- Program 6 Stata program to add partner variables
Create Longitudinal Files
There are a number of ways users might want to create a balanced longitudinal file:
- Wide file of responding persons – this is where we keep only people responding in all waves and put the variables for each wave next to each other (that is, there is one row of data for each person).
- Wide file of enumerated persons – this is where we keep only those people who were in responding households in all waves and the variables for each wave are put next to each other.
- Long file of responding persons – this is where we keep only people responding in all waves and the information for each wave is stacked together (that is, there is a separate row of data for each wave of information for each person).
- Long file of enumerated persons – this is where we keep only those people who were in responding households in all waves and the information for each wave is stacked together.
Most users will probably want to restrict the files to only include respondents or people from responding households. A few users may also want to add people who have died or moved out of scope (depending on the research question they are answering).
The programs showing how to create balanced long files of responding persons are:
- Program 7 SAS program to create long longitudinal files
- Program 8 SPSS program to create long longitudinal files
The wide files are created by matching the responding or enumerated files for each wave together using xwaveid. An alternative way to strip off the first letter of the variable names in SAS is provided in:
- Program 9 SAS macro to strip the first letter from the variable name (originally provided by Bruce Bradbury)
Some users may want to create an unbalanced panel – where you take all respondents or enumerated persons available at each wave (not just those that consistently respond or are consistently in responding households). An example Stata program to create a balanced or unbalanced panel is provided in:
- Program 10 Stata program to create long longitudinal files
Example programs to create wide files are provided in:
- Program 11 SAS program to create wide longitudinal files
- Program 12 SPSS program to create wide longitudinal files
- Program 13 Stata program to create wide longitudinal files
The longitudinal weights on the enumerated person file and the responding person file are for the full balanced panel of respondents and enumerated persons from wave 1 (i.e., across the first two, three, ... nine waves). If you are constructing a balanced panel with different specifications, you should find a suitable weight in the longitudinal weights file. Out of scopes (deaths and moves overseas) are treated as acceptable outcomes, so these people have weights applied as well.
Provided by HILDA Users
Users of the HILDA data can contribute code to this library if they believe it may be beneficial to other users. Please send your code to [email protected]. The HILDA team does not take responsibility for the correctness of these programs.
- SAS macro and example program for the calculation of standard errors via the Jacknife method (provided by Bruce Bradbury, 9 January 2009; updated 12 February)
- SAS program to create a long longitudinal file, repeat code across multiple HILDA waves and strip the first letter from variable names unless it is an X. (Provided by Bruce Bradbury, 22 February. For further updates, see Bruce’s webpage.)
- Stata ado file to create a longitudinal file in long format from the HILDA datasets by extracting variables from the combined files, master file and longitudinal weights file (Provided by Paco Perales, 23 May 2013).
See also PanelWhiz, which provides a common front end to a range of panel datasets (including HILDA) which allows users to select vectors of variables and the matching and merging is done automatically.
Endnotes:
1 | This program requires at least 1.3gb memory to run. If your computer does not have this much memory then you will need to restrict the datasets to only the subset of variables you need. |