Setting/changing variable types (converting)
This article is part of the Definitive Guide to Uploading and Preparing Data.
Sometimes the data is incorrectly encoded as the wrong variable type. For example, the data of a scale is encoded as numerical when actually it's a categorical (ordinal) scale. This is not uncommon with SPSS datafiles (and partly why SPSS files are not necessarily the optimal file type).
If possible, try to correctly set your variable type before it's encoded into a datafile (eg: an SPSS file), and thus before it's brought into Crunch.
Note: when it comes to tracking studies, you may need to align variables by type before you can append (ie: merge waves).
You can change the variable type once a variable is in Crunch.
In the web app
- You can see the Variable Type under a variable's Properties, but you can't change it there.
- You use the Convert button (the little cog) on a variable card.
Using R
- See type() in crunch R package documentation.
Crunch Automation
- either REPLACE CONVERT or CREATE CONVERT