nominal variables into strings

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

Mikash
Posts: 7
Joined: Thu Dec 08, 2016 10:30 am

nominal variables into strings

Postby Mikash » Thu Dec 08, 2016 10:41 am

Hello everyone.
The question is I have nominal variables in different bases with not the same value labels, so we deside to reverse all valiables into strings, but I don't know how to save the labels, but not the values. Is there some syntax command for those cases or maybe there is some other way to do it?
Doing it by saving document as Excel with labels and copiing it back to spss is too long, because bases are big.
Thanks
statman
Administrator
Posts: 2699
Joined: Tue Jun 12, 2007 12:08 pm
Location: Florida, USA

Re: nominal variables into strings

Postby statman » Thu Dec 08, 2016 1:18 pm

Sorry, not really clear. Can you give an example and also .............
See the note below

NOTE: Please read the Posting Guidelines and always tell us your OS, the SPSS version and information about your study and data!

Statman
Statistical Services
Mikash
Posts: 7
Joined: Thu Dec 08, 2016 10:30 am

Re: nominal variables into strings

Postby Mikash » Fri Dec 09, 2016 1:52 pm

Ok, i have variable City
veriable level City (Nominal).
value labels City
1 'Moscow'
2 'Kiev'
3 'Novgorod'
4 'New York'....

data displays as
1
3
2
1
4
...

and I need to reverse it into words and save as string (i.e. change level of variable from nominal to string, but save not numbers but words):
Moscow
Novgorod
Kiev
Moscow
New York
....
statman
Administrator
Posts: 2699
Joined: Tue Jun 12, 2007 12:08 pm
Location: Florida, USA

Re: nominal variables into strings

Postby statman » Fri Dec 09, 2016 2:23 pm

So the city labels are NOT being shown?

Also, why this need might help offer suggestion

Then again, SPSS version & your OS
Mikash
Posts: 7
Joined: Thu Dec 08, 2016 10:30 am

Re: nominal variables into strings

Postby Mikash » Fri Dec 09, 2016 3:23 pm

Sorry, I expressed incorrectly.
the TYPE of variable City is Numeric (level is Nominal). And I need Type String, but seeing in words, not numbers.
If I just change the Type by hands it returns numbers with spases (if I delite values of variable there gonna be just numbers in data).

And again City labels are shown but I need to change Type and being them strings with words.

Version spss 22
OS windows 7
statman
Administrator
Posts: 2699
Joined: Tue Jun 12, 2007 12:08 pm
Location: Florida, USA

Re: nominal variables into strings

Postby statman » Fri Dec 09, 2016 4:43 pm

OK, if understand, below is an illustrative code for the STRING + RECODE Function set found under Transform > Recode into different variables - Set your variable name then the Old New tab at the bottom and set the Output variable as String + width

Code: Select all

STRING S4String (A40).
RECODE s4 (1='Within next 6 months') (2='Within next year') (3='Within next 2 years') (4='Within '+
    'next 4 years') INTO S4String.
EXECUTE.
You should have this in V22

Let us know how goes
Mikash
Posts: 7
Joined: Thu Dec 08, 2016 10:30 am

Re: nominal variables into strings

Postby Mikash » Tue Dec 13, 2016 9:20 am

Thank you, I'll try it

Who is online

Users browsing this forum: No registered users and 1 guest

cron