1 / 21

SPSS Tutorial 101: Import, Merge and Save Data Sets

SPSS Tutorial 101: Import, Merge and Save Data Sets. Dr. Daisy Dai Department of Medical Research. Example: CDC Survey Data. An allergy survey was conducted in 2005 and 2006 to children more than 1 year old.

Download Presentation

SPSS Tutorial 101: Import, Merge and Save Data Sets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SPSS Tutorial 101: Import, Merge and Save Data Sets Dr. Daisy Dai Department of Medical Research

  2. Example: CDC Survey Data • An allergy survey was conducted in 2005 and 2006 to children more than 1 year old. • Two data sets, allergy questionnaire and demographic information, are saved in sas export format.

  3. Tasks • Import these two SAS data files to SPSS and save them as SPSS data file. • Sort each data set by study ID. • Merge allergy variables and demographic variables. • Save new data set as SPSS data file.

  4. Log in SPSS • CMH offers server version SPSS 18. Any employee can log in SPSS from your employee account. • Go to Start ->Program ->Accessories -> Remote Desktop Connection

  5. Log in SPSS • In the prompted connection window, enter cmhterm. • Click Connect.

  6. Log in SPSS • In the Log On Window, enter your cmh user name and password. • Choose log on to CMH • Click OK.

  7. Task 1: Import Data • We need to import two data sets to SPSS. • Allergy qustionaire: aqq_d.xpt (xpt is sas export file) • Demographic information: demo_d.xpt • Please note that SPSS is on server and data must be saved in shared drive such as u drive or w drive. You will not be able to find the file in SPSS if you save them on your local disk.

  8. Task 1: Import Data • Double click spss 18 icon on the screen. • In the task wizard, click Open an existing source. • Click OK.

  9. Task 1: Import Data • Just in case wizard does not prompt, you can go to file -> Open -> Data

  10. Task 1: Import Data • Select the folder. • Choose agg_d file. • Select xpt format. • Click Open. • Note: SPSS is compatible with other commonly used statistical and data management software packages. Excel, SAS, Access files are all convertible to SPSS.

  11. Task 1: Import Data • Now the data is open. • You can see the data in “data View” tab.

  12. Task 1: Import Data • The data structure, variable name, label, etc. are in “Variable View” tab.

  13. Task 2: Sort Data • Variable to be sort: SEQN, that is, Respondent sequence number.

  14. Task 2: Sort Data • Go to Data and select Sort Cases. • On Sort Cases page, select the variable, Respondent sequence number. • Click on right arrow. • Choose Ascending or Descending. • Click OK.

  15. Practice • Now let repeat this process by doing the following: • Open the demographic data, demo_d.xpt. • Sort the data by variable, Respondent Sequence Number.

  16. Task 3: Merge Two Data Sets • Two data sets need to be linked by key variables. • In our case, the key variable is SEQN-Respondent Sequence Number. • Make sure the key variable has the same name and variable type in two data sets. • Both data sets needs to be sorted by the key variable.

  17. Task 3: Merge Two Data Sets • Under any data set, go to Data -> Merge File -> Add Variables

  18. Task 3: Merge Two Data Sets • Choose the other data to add on. • Note, this page will look different in SPSS 18. By all means, choose the other data set.

  19. Task 4: Save the New Data • Go to File -> Save As… • Select the folder. • Create new file, MergedData. • Choose SPSS data format. • Click Save.

  20. Task 4: Save the New Data • Go to Data -> Merge File -> Add Variables

  21. Thank you!

More Related