The R code to calculate marital compatibility between people with different academic degrees
- You need R, and I recommend RStudio
- Unzip the IPUMS data (
ipums/usa_00094.sav.zip
) file manually or viaunzip ipums/usa_00094.sav.zip
The raw data was compiled from six years of American Community Survey data via ipums.org, the fantastic Census microdata site, in SPSS format (.sav
) for easy importing into R. You can see the codebook for the extract at ipums/usa_00094.txt
, which contains all the information on the variables that were extracted.
Citation: IPUMS-USA, University of Minnesota, www.ipums.org.
You need the "foreign" library, which you can install manually through the R interface or like so:
install.packages("foreign")
Then open analyze.R
to see the heavily commented code, data.Rproj
in RStudio for a nice visual version, or just run the file:
RScript analyze.R
This will spit out a file called filtered.csv
with all of the information used in the interactive.
Creative Commons Attribution 4.0
tl;dr
You are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
- You must give appropriate credit by linking to this repository and the associated TIME article, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.