Value Labels help

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Value Labels help

Tufayel Chowdhury
Hi all,

I have 50 different activity-codes like the following - 

Code   Description

011      Work for Pay at Main Job
012      Work for Pay at Other Job(s)
021      Overtime Work
022      Looking for Work
...
...

Is there an automatic way to do this or do I have to manually input the value labels in Variable View?

Thanks!
Tufayel

Reply | Threaded
Open this post in threaded view
|

Re: Value Labels help

mpirritano

VALUE LABELS variablename

‘011’ ‘Work for Pay at Main Job’

‘012’ ‘ Work for Pay at Other Job(s)’

End with a period at end of last line.

 

No exe required. Just run.

 

Don’t forget about the manual! Help -> command syntax reference

 

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Tufayel Chowdhury
Sent: Thursday, February 10, 2011 1:15 PM
To: [hidden email]
Subject: Value Labels help

 

Hi all,

 

I have 50 different activity-codes like the following - 

 

Code   Description

 

011      Work for Pay at Main Job

012      Work for Pay at Other Job(s)

021      Overtime Work

022      Looking for Work

...

...

 

Is there an automatic way to do this or do I have to manually input the value labels in Variable View?

 

Thanks!

Tufayel

 

Reply | Threaded
Open this post in threaded view
|

Re: Value Labels help

parisec
In reply to this post by Tufayel Chowdhury
You can use syntax:
 
 
Value Labels Code 011 'Work for Pay at Main Job'
                            012  'Work for Pay at Other Job(s)'
                            021 'Overtime Work'
                            022 'Looking for Work'
                              ....
 
You don't have to line them up as i did. It just makes it easier to see the pattern.
 
 


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Tufayel Chowdhury
Sent: Thursday, February 10, 2011 1:15 PM
To: [hidden email]
Subject: Value Labels help

Hi all,

I have 50 different activity-codes like the following - 

Code   Description

011      Work for Pay at Main Job
012      Work for Pay at Other Job(s)
021      Overtime Work
022      Looking for Work
...
...

Is there an automatic way to do this or do I have to manually input the value labels in Variable View?

Thanks!
Tufayel

Reply | Threaded
Open this post in threaded view
|

Re: Value Labels help

Art Kendall
In reply to this post by Tufayel Chowdhury
Of course a lot depends where the text you are interested in is currently. You might be able to paste it into a word processing program or just a syntax window and edit in the value label command and the list of variables, the single quotes, the final slash, and the terminating period.

You could do something like this supposing you have 10 variables that have those value possible.
create this syntax in your favorite editor or just type it in as text in a syntax window.

value labels week1 to week10
011      'Work for Pay at Main Job'
012      'Work for Pay at Other Job(s)'
021      'Overtime Work'
022      'Looking for Work'
. . .
099      'undecipherable'/.

When it is complete make sure the file you want to apply it to is open.  select the syntax.  Click the big green arrow-looking icon.
switch to the data window and variable view. Check that it worked.

Art Kendall
Social Research Consultants



On 2/10/2011 4:14 PM, Tufayel Chowdhury wrote:
Hi all,

I have 50 different activity-codes like the following - 

Code   Description

011      Work for Pay at Main Job
012      Work for Pay at Other Job(s)
021      Overtime Work
022      Looking for Work
...
...

Is there an automatic way to do this or do I have to manually input the value labels in Variable View?

Thanks!
Tufayel

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Value Labels help

Alex Karner
In reply to this post by Tufayel Chowdhury

Well, if you have many (100+) different pairs code-description, it is easier and faster to use Excel or Calc.

Just enter a suitable formula for concatenating cells in column C and copy-paste it for all combinations, as shown below.

Then copy entire column C in a syntax window, add 'VALUE LABELS variablename' before and '.' after and run.

 

                A             B                                                                                           C

1    Code Description                   

2    011  Work for Pay at Main Job       ="'"&A2&"'  '"&B2&"'"

3    012  Work for Pay at Other Job(s)   ="'"&A3&"'  '"&B3&"'"

4    021  Overtime Work                  ="'"&A4&"'  '"&B4&"'"

5    022  Looking for Work               ="'"&A5&"'  '"&B5&"'"

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Tufayel Chowdhury
Sent: Thursday, February 10, 2011 10:15 PM
To: [hidden email]
Subject: Value Labels help

 

Hi all,

 

I have 50 different activity-codes like the following - 

 

Code   Description

 

011      Work for Pay at Main Job

012      Work for Pay at Other Job(s)

021      Overtime Work

022      Looking for Work

...

...

 

Is there an automatic way to do this or do I have to manually input the value labels in Variable View?

 

Thanks!

Tufayel

 

Reply | Threaded
Open this post in threaded view
|

Re: Value Labels help

Bruce Weaver
Administrator
In reply to this post by Tufayel Chowdhury
Tufayel Chowdhury wrote
Hi all,

I have 50 different activity-codes like the following -

Code   Description

011      Work for Pay at Main Job
012      Work for Pay at Other Job(s)
021      Overtime Work
022      Looking for Work
...
...

Is there an automatic way to do this or do I have to manually input the value
labels in Variable View?

Thanks!
Tufayel
As Matthew and Art have said, you can use a VALUE LABELS command.  I'll add that if you have the list of 50 codes and matching descriptions in another file, you can eliminate a lot of tedious work by doing something like this:

data list / code 1-3 (A) descript 10-50(A).
begin data
011      Work for Pay at Main Job
012      Work for Pay at Other Job(s)
021      Overtime Work
022      Looking for Work
end data.

string newstring(a50).
compute newstring = concat(" ",code," '",rtrim(descript),"'").
list newstring.


You would paste your entire list of codes and descriptions between the "begin data" and "end data" lines, of course.

The output from that last LIST command looks like this:

newstring

 011 'Work for Pay at Main Job'
 012 'Work for Pay at Other Job(s)'
 021 'Overtime Work'
 022 'Looking for Work'

Number of cases read:  4    Number of cases listed:  4

So you can copy that output, and paste it into a VALUE LABELS command like this:

VALUE LABELS variable_name
 011 'Work for Pay at Main Job'
 012 'Work for Pay at Other Job(s)'
 021 'Overtime Work'
 022 'Looking for Work'
.

HTH.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Value Labels help

John F Hall
Tufayel
 
You already have helpful previous replies, but if you're new to syntax rather than using the GUI, you need to click:
 
File > New > Syntax
 
to open a new syntax window, then type in your value labels command: see the step-by-step tutorials (full colour screenshots at each step) in http://surveyresearch.weebly.com/block-1-from-questionnaire-to-spss-saved-file.html  on my website, especially
 
 
Hope this helps
 
 
----- Original Message -----
Sent: Thursday, February 10, 2011 11:56 PM
Subject: Re: Value Labels help

Tufayel Chowdhury wrote:

>
> Hi all,
>
> I have 50 different activity-codes like the following -
>
> Code   Description
>
> 011      Work for Pay at Main Job
> 012      Work for Pay at Other Job(s)
> 021      Overtime Work
> 022      Looking for Work
> ...
> ...
>
> Is there an automatic way to do this or do I have to manually input the
> value
> labels in Variable View?
>
> Thanks!
> Tufayel
>
>

As Matthew and Art have said, you can use a VALUE LABELS command.  I'll add
that if you have the list of 50 codes and matching descriptions in another
file, you can eliminate a lot of tedious work by doing something like this:

data list / code 1-3 (A) descript 10-50(A).
begin data
011      Work for Pay at Main Job
012      Work for Pay at Other Job(s)
021      Overtime Work
022      Looking for Work
end data.

string newstring(a50).
compute newstring = concat(" ",code," '",rtrim(descript),"'").
list newstring.


You would paste your entire list of codes and descriptions between the
"begin data" and "end data" lines, of course.

The output from that last LIST command looks like this:

newstring

 011 'Work for Pay at Main Job'
 012 'Work for Pay at Other Job(s)'
 021 'Overtime Work'
 022 'Looking for Work'

Number of cases read:  4    Number of cases listed:  4

So you can copy that output, and paste it into a VALUE LABELS command like
this:

VALUE LABELS variable_name
 011 'Work for Pay at Main Job'
 012 'Work for Pay at Other Job(s)'
 021 'Overtime Work'
 022 'Looking for Work'
.

HTH.


-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Value-Labels-help-tp3380128p3380339.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD