ImportPSIDdata

You can import PSID data sets into Matlab using ImportPSIDdata.m function I created.

  • Download ImportPSIDdata.m (you can either put it in your active folder, or better yet add it to the Matlab path). [Github]
  • Download your PSID dataset with the ‘xml’ cookbook and with the data for SPSS.
  • Check what you ‘jobname’ is (eg. my downloaded data set is a file called J179504.txt, so J179504 is the jobname).
  • Rename the ‘.sps’ to ‘_sps.txt’; if you don’t then the command will just remind of this anyway.
  • In Matlab, run command MyPSIDdataset=ImportPSIDdata(jobname) [eg. ImportPSIDdata(‘J179504’)]
  • Done!
  • MyPSIDdataset is a matlab structure containing all of the data and metadata (so it not only contains variable values, it also contains their names and codes).