In Harmoni, you can use data from various file types as the source for new projects, visualizations, and dashboards.
Learn how to best prepare your SPSS .sav file before importing the data into Harmoni.
In this article
- Variable Types
- Variable Labels
- Multiple Response Sets
- Other Considerations
1. Variable Types
Ensure that the variable type assigned to the variable in SPSS is aligned with how the variable is to be analyzed within Harmoni.
To see named elements appear in Harmoni, at least one value in the variable must have a value label in SPSS.
SPSS variables that have a label assigned to at least one value and are a numeric type will appear as standard axes in Harmoni.
- Please ensure values have labels unless they are variables with true numeric values i.e., exact age, volume, number of people, etc.
- SPSS variables that have no value labels and are numeric types will appear as measures in Harmoni.
- Measures display both the variable name and label.
- Where there are no variable labels, Harmoni will use the variable name and append the row number to it.
SPSS variables with no value labels and are date type will appear as measures in Harmoni.
- SPSS has a particular way to store the dates. SPSS date variables are numeric variables; their actual values are just numbers. These values are what Harmoni has stored for the date measure. In SPSS, the date values are the number of seconds between the year 1582 and the start (midnight) of a given date." Note that one day is 60 (seconds) * 60 (minutes) * 24 (hours) = 86400.
SPSS variables that have no value labels and are a string type will appear as text items in Harmoni e.g., open-ended questions with the actual text.
- In the case of string type with same label, if the first 5 characters of the variable name are the same, they will be combined together.
- Harmoni will automatically recognize a variable as a weight, when the SPSS file has been saved with weighted cases.
- If cases are not weighted in the SPSS file, Harmoni will import the variable as a measure. You then need to define the weight in Harmoni.
2. Variable labels
For ease of use and to minimize relabeling work in Harmoni, consideration should be given to labeling options within the sav file.
- Harmoni presents the variable labels in the sav file within the data tree.
- Variable labels should, therefore, be meaningful and include the question number from the questionnaire.
- Duplicate labels that don’t appear sequentially will include their variable name in the Harmoni label.
To automate the creation of a gridded item, the variables in SPSS need to have the same (or at least 80% similar) element labels.
To automate the creation of a combined item for multiple response variables, the variables in SPSS need to appear sequentially and have the same variable label, the value labels can vary across the variables.
When automation is applied to the source data load, multiple response sets constructed in SPSS appear as multiple response variables within Harmoni. Any variables used in a multiple response set are not displayed in their original state within Harmoni
3. Multiple response sets
A multiple response set can be defined in a sav file, which will result in multiple response variables being available within Harmoni. Multiple response sets:
- will appear at the bottom of the Harmoni Project.
- are automatically recognized and generate multiple response items in Harmoni when the import automation option is on.
Multiple response sets are either defined using either a Dichotomy or a Category
- A multiple dichotomy set typically consists of multiple dichotomous variables.
- Used if the source variables identify the ‘brand’, with responses Yes, and No.
- In the multiple dichotomy set, the Counted Value is 1.
- Multiple response variables that have been created using a dichotomy definition bring only Yes’s.
- Used if the source variables identify the 1st response, 2nd response, etc. and the responses identify the ‘brand’. Note, it’s not always actually a brand, but hopefully, the ‘brand’ example is one that resonates!
- Multiple response variables that have been created using a category definition bring all value labels through into the multiple response items. However, if all the variables being brought together do not have identical value labels and codes, the Multiple Response Set merges based on values and just assigns the labels from the first variable in the group. This can cause items to merge that really shouldn’t. Please ensure that any multiple response sets identified using the category definition have identical value codes and labels across the variables being included in the set.
When you import or connect to an SPSS file with multiple response sets using a category definition, results will differ depending on whether you use automation or not.
Load Without Automation
When an SPSS file is loaded without automation, Harmoni imports the multiple response set and the original variables.
Load With Automation
When an SPSS file is loaded with automation, Harmoni imports the multiple response set and includes the original variables as a combined item.
This combined item can be deconstructed or converted into a construction. With both these actions, the original items are added into the project tree
Defining a Multiple Response Set in SPSS
- In SPSS, from the menus, choose: Data > Define Multiple Response Sets...
- Select two or more variables. If your variables are coded as dichotomies, indicate which value you want to have counted i.e. 1 for yes (checked.)
- Under SetName: Enter a unique name for each multiple response set. The name can be up to 63 bytes long. A dollar sign is automatically added to the beginning of the set name.
- Under SetLabel: Enter a descriptive label for the set. (This is optional.)
- Click Add to add the multiple response set to the list of defined sets.
For Multi response sets, the Set Name must be unique and not have the same name as any variable label.
4. Other considerations
Coded responses must have labels.
Looped questions must have a separate variable for each loop combination.
Cleaned data, with only valid respondents. All respondents asked the question should have a response. Respondents who were not asked the question don’t have any response.
Ensure files are not encrypted.
One reason SAV files may increase in size is if their strings are set to be much longer than they need to be. Below is an SPSS script which adjusts the length of the string to be the size of the longest string. You need to specify the location and name of the input file as well as the location and name of the output file.
GET FILE = 'Drive:\Folder\Filename.sav'.
ALTER TYPE ALL (A=AMIN).
SAVE OUTFILE = 'Drive:\Folder\NewFileName.sav'.