Introduction
Q does not support all of the alternative syntax file specifications. What Q does support is best appreciated by the following example of a SPSS syntax file:
Method
* Sample SPSS Syntax file for importing a CSV file.. GET DATA /TYPE=TXT /FILE='sample_sps.csv' /ARRANGEMENT=DELIMITED /* CSV file /FIRSTCASE=2 /* ignore variable names in first line /VARIABLES = Q1 A Q2 F Q3 F Q4 F. /* lists variables in the order they appear. A for text variables, F for numeric. VARIABLE LEVEL Q2 Q4 (NOMINAL) /* categorical /Q3 (SCALE). /* numeric VARIABLE LABELS Q1 'Question one' /Q2 'Question two' /Q3 'Question three' /Q4 'Question four'. VALUE LABELS Q2 Q4 1 'Yes' 2 'No'.
The corresponding data file should then be setup as a CSV file (.csv
) or an ASCII file (.dat
). These are easily created by saving a spreadsheet in Excel as a CSV file (File, Save as..., Save as type: CSV (Comma delimited). The spreadsheet that corresponds to the above syntax is:
Once a .sps
file has been created it then needs to be converted into an SPSS data file using Converting SPSS Syntax Files into Data Files.
See Also
How to Convert SPSS Syntax Files into SPSS Data Files
How to Format an SPSS File for Use in Q
How to Convert Other Files Types into SPSS or CSV Data Files
How to Save a Modified Copy of an SPSS or CSV File
Comments
0 comments
Article is closed for comments.