Simple syntax question

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

Simple syntax question

Myers, Nicholas

Hello.

 

I write to ask how in SPSS syntax language to make Variable Value Labels.

I can do this through point and click (Variable View → Values etc.)

but I assume that there must be a way to do this through SPSS syntax.

 

For example, suppose I have a binary variable named “gender.”

I‘d like each 0 value to have a Label of “male”

and 1 value to a Label of “female.”

 

What syntax would I need to write?

 

Thank you.

 

nick

 

-----------------------------------------------------------------------

Nicholas D. Myers, Ph.D.               
University of Miami
School of Education
Department of Educational and Psychological Studies

Research, Measurement and Evaluation program

 

Merrick Building 311E
P.O. Box 248065
Coral Gables, FL 33124-2040

 

Tel: 305.284.9803
Fax: 305.284.3003
E-mail: [hidden email]
http://www.education.miami.edu/facultyStaff/Faculty_Bio.asp?ID=143
-----------------------------------------------------------------------

 

Reply | Threaded
Open this post in threaded view
|

Re: Simple syntax question

Spousta Jan
val lab gender 0 "male" 1 "female".
 
Hope this helps,
 
Jan


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Myers, Nicholas
Sent: Tuesday, November 23, 2010 5:03 PM
To: [hidden email]
Subject: Simple syntax question

Hello.

 

I write to ask how in SPSS syntax language to make Variable Value Labels.

I can do this through point and click (Variable View → Values etc.)

but I assume that there must be a way to do this through SPSS syntax.

 

For example, suppose I have a binary variable named “gender.”

I‘d like each 0 value to have a Label of “male”

and 1 value to a Label of “female.”

 

What syntax would I need to write?

 

Thank you.

 

nick

 

-----------------------------------------------------------------------

Nicholas D. Myers, Ph.D.               
University of Miami
School of Education
Department of Educational and Psychological Studies

Research, Measurement and Evaluation program

 

Merrick Building 311E
P.O. Box 248065
Coral Gables, FL 33124-2040

 

Tel: 305.284.9803
Fax: 305.284.3003
E-mail: [hidden email]
http://www.education.miami.edu/facultyStaff/Faculty_Bio.asp?ID=143
-----------------------------------------------------------------------

 

 

_____________

Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Jestliže jste tento mail dostali neoprávněně, prosím, uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto přenosem.

P Jste si jisti, že opravdu potřebujete vytisknout tuto zprávu a/nebo její přílohy? Myslete na přírodu.

 


This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the message as well as all attached documents. The sender does not accept liability for any errors or omissions as a result of the transmission.

 

P Are you sure that you really need a print version of this message and/or its attachments? Think about nature.

-.- --
Reply | Threaded
Open this post in threaded view
|

Re: Simple syntax question

mpirritano
In reply to this post by Myers, Nicholas

Value labels gender

0 $B!F (Bmale $B!G (B

1 $B!F (Bfemale $B!G (B.

 

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 Myers, Nicholas
Sent: Tuesday, November 23, 2010 7:54 AM
To: [hidden email]
Subject: Simple syntax question

 

Hello.

 

I write to ask how in SPSS syntax language to make Variable Value Labels.

I can do this through point and click (Variable View $B"* (B Values etc.)

but I assume that there must be a way to do this through SPSS syntax.

 

For example, suppose I have a binary variable named $B!H (Bgender. $B!I (B

I $B!F (Bd like each 0 value to have a Label of $B!H (Bmale $B!I (B

and 1 value to a Label of $B!H (Bfemale. $B!I (B

 

What syntax would I need to write?

 

Thank you.

 

nick

 

-----------------------------------------------------------------------

Nicholas D. Myers, Ph.D.               
University of Miami
School
of Education
Department of Educational and Psychological Studies

Research, Measurement and Evaluation program

 

Merrick Building 311E
P.O. Box 248065
Coral Gables, FL 33124-2040

 

Tel: 305.284.9803
Fax: 305.284.3003
E-mail: [hidden email]
http://www.education.miami.edu/facultyStaff/Faculty_Bio.asp?ID=143
-----------------------------------------------------------------------

 

Reply | Threaded
Open this post in threaded view
|

Re: Simple syntax question

Bruce Weaver
Administrator
In reply to this post by Myers, Nicholas
In the spirit of teaching a man to fish...

Help - Topics - Index; then search for "VALUE LABELS (command), compared with ADD VALUE LABELS command", and click on the Examples link at the bottom.


Myers, Nicholas wrote
Hello.



I write to ask how in SPSS syntax language to make Variable Value Labels.

I can do this through point and click (Variable View → Values etc.)

but I assume that there must be a way to do this through SPSS syntax.



For example, suppose I have a binary variable named “gender.”

I‘d like each 0 value to have a Label of “male”

and 1 value to a Label of “female.”



What syntax would I need to write?



Thank you.

nick

-----------------------------------------------------------------------
Nicholas D. Myers, Ph.D.
University of Miami
School of Education
Department of Educational and Psychological Studies
Research, Measurement and Evaluation program

Merrick Building 311E
P.O. Box 248065
Coral Gables, FL 33124-2040

Tel: 305.284.9803
Fax: 305.284.3003
E-mail: nmyers@miami.edu<mailto:nmyers@miami.edu>
http://www.education.miami.edu/facultyStaff/Faculty_Bio.asp?ID=143
-----------------------------------------------------------------------
--
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: Simple syntax question

John F Hall
In reply to this post by Myers, Nicholas
Have a look at the entry-level SPSS tutorials on my website, especially the
ones on extending data dictionaries.  VALUE LABELS are covered in 1.4.2 in
Block 1, and 2.1.2.5 and 2.2.1.3 in Block 2.  They're all syntax-based with
full colour screenshots at each step.  Altogether there are about 400 pages
of similar tutorials which assume no previous knowledge of SPSS and start
from absolute scratch with a short questionnaire to complete, then
transcribing data and entering it into a *.txt file before using SPSS to
read in the data, save a *.sav file and, in stages, add dictionary
information until a final version is achieved.

They then repeat these exercises on real data from actual surveys, before
proceeding to tabulation using FREQUENCIES and CROSSTABS.   There are also
tutorials on data transformations and derived variables.

John Hall
[hidden email]
http://surveyresearch.weebly.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