- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
I am importing a .sav file (SPSS format) in SAS, and I am having some issues.
SAS imports the file smoothly (i.e., no errors or warnings), but categorical variables in SPSS are all labelled NUM (numerical variables) in SAS. For instance, a variable INCOME that includes values such as:
"less than $5,000"
"$15,000-19,999"
"$20,000-29,999"
...
is shown as type = NUM.
In fact, if I ask for a correlation (PROC CORR) between INCOME and another variable that contains only numbers, and it is clearly numerical, SAS computes it.
But what is the meaning?
How does SAS turn the values of INCOME into numbers?
Is there a way to ask for that info?
And additional issue is that if I use the values that SAS shows when I print a table with PROC FREQ for the variable INCOME (e.g. "than $5,000") to compute a third variable, SAS does not recognize the values of INCOME.
Thanks for any advice you may have.
Eman
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I suspect that the variables in the SPSS file were numeric with "value labels" attached. Perhaps Something like 1 means "less thatn $5000" and 2 means etc.
In SAS you use a FORMAT to tell SAS to display a value as something else.
If you want PROC IMPORT to convert those "value labels" into FORMATs then you need to tell it what format catalog to write the formats into. And if you want SAS to be able to use the generated formats to display the numbers as that text then you need to tell SAS where to find those formats by setting the appropriate value of the FMTSEARCH system option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I suspect that the variables in the SPSS file were numeric with "value labels" attached. Perhaps Something like 1 means "less thatn $5000" and 2 means etc.
In SAS you use a FORMAT to tell SAS to display a value as something else.
If you want PROC IMPORT to convert those "value labels" into FORMATs then you need to tell it what format catalog to write the formats into. And if you want SAS to be able to use the generated formats to display the numbers as that text then you need to tell SAS where to find those formats by setting the appropriate value of the FMTSEARCH system option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thanks for the suggestion. I have resolved the import by adding
proc datasets;
modify SPSS;
format _all_;
quit;
Eman