SAS Equivalent of SPSS Variable Labels

SAS Equivalent of SPSS Variable Labels

Post by Michael Sau » Sat, 03 Aug 2002 07:23:00



Does SAS have the equivalent of the SPSS Variable Labels?

For example:

VALUE LABELS  I1 TO I98
1 'NOT IMPORTANT AT ALL'
2 'NOT VERY IMPORTANT'
3 'SOMEWHAT UNIMPORTANT'
4 'NEUTRAL'
5 'SOMEWHAT IMPORTANT'
6 'IMPORTANT'
7 'VERY IMPORTANT'
0 'DOES NOT APPLY'

This allows labels to be established for the possible values of a
variable.

Thanks for your help.

Mike Sauer

 
 
 

SAS Equivalent of SPSS Variable Labels

Post by Willem Boersm » Sat, 03 Aug 2002 21:55:38


Michael,

The equivalent of a SAS Value Label (Not the Variable Label - that is the
SAS "LABEL" Statement) is a SAS Format, that you build with PROC FORMAT.
There is a crucial difference however: SAS Formats are independent to the
variable: you build one first, store it, and you apply it to a variable
later. You can also perform a "Recode" with a SAS Format.

Willem Boersma
PW Consulting


Quote:> Does SAS have the equivalent of the SPSS Variable Labels?

> For example:

> VALUE LABELS  I1 TO I98
> 1 'NOT IMPORTANT AT ALL'
> 2 'NOT VERY IMPORTANT'
> 3 'SOMEWHAT UNIMPORTANT'
> 4 'NEUTRAL'
> 5 'SOMEWHAT IMPORTANT'
> 6 'IMPORTANT'
> 7 'VERY IMPORTANT'
> 0 'DOES NOT APPLY'

> This allows labels to be established for the possible values of a
> variable.

> Thanks for your help.

> Mike Sauer


 
 
 

SAS Equivalent of SPSS Variable Labels

Post by Gerstle, Jo » Sat, 03 Aug 2002 21:41:56


Like so:

PROC FORMAT;
        VALUE LABELS
                1 = 'NOT IMPORTANT AT ALL'
                2 = 'NOT VERY IMPORTANT'
                3 = 'SOMEWHAT UNIMPORTANT'
                4 = 'NEUTRAL'
                5 = 'SOMEWHAT IMPORTANT'
                6 = 'IMPORTANT'
                7 = 'VERY IMPORTANT'
                0 = 'DOES NOT APPLY';
run;

data whatever; set whatever1;
        format I1-I98 labels.;
run;

I believe that'll do ya.  May need to double check syntax, but I think I'm
correct here.

Though this is only for formats, not labels per se, and is only good for the
present SAS session.  If you want these format to be permanent, you can
create an external format catalog.  Check the SAS Online Help for more on
that, or someone on the list may have a quick explanation.

John Gerstle
Biostatistician
CDC Information Systems Support Services (CISSS)
Contractor Support to NCHSTP / Division of HIV/AIDS Prevention
Phone: 404-639-3980
Fax: 404-639-2980
Cell: 770-639-5060

-----Original Message-----

Sent: Thursday, August 01, 2002 6:23 PM

Subject: SAS Equivalent of SPSS Variable Labels

Does SAS have the equivalent of the SPSS Variable Labels?

For example:

VALUE LABELS  I1 TO I98
1 'NOT IMPORTANT AT ALL'
2 'NOT VERY IMPORTANT'
3 'SOMEWHAT UNIMPORTANT'
4 'NEUTRAL'
5 'SOMEWHAT IMPORTANT'
6 'IMPORTANT'
7 'VERY IMPORTANT'
0 'DOES NOT APPLY'

This allows labels to be established for the possible values of a
variable.

Thanks for your help.

Mike Sauer

 
 
 

SAS Equivalent of SPSS Variable Labels

Post by Ed Heat » Sat, 03 Aug 2002 21:49:51


Mike,

SAS has value-label formats; each format has a name.  You associate the name
of the format with the variable.

See the FORMAT procedure and the FORMAT statement in your SAS documentation.

Ed

Edward Heaton, Senior Systems Analyst,
Westat (An Employee-Owned Research Corporation),
1550 Research Boulevard, Room 2018, Rockville, MD 20850-3195
Voice:  (301) 610-4818                 Fax:  (301) 294-3992

-----Original Message-----

Sent: Thursday, August 01, 2002 6:23 PM

Subject: SAS Equivalent of SPSS Variable Labels

Does SAS have the equivalent of the SPSS Variable Labels?

For example:

VALUE LABELS  I1 TO I98
1 'NOT IMPORTANT AT ALL'
2 'NOT VERY IMPORTANT'
3 'SOMEWHAT UNIMPORTANT'
4 'NEUTRAL'
5 'SOMEWHAT IMPORTANT'
6 'IMPORTANT'
7 'VERY IMPORTANT'
0 'DOES NOT APPLY'

This allows labels to be established for the possible values of a
variable.

Thanks for your help.

Mike Sauer

 
 
 

1. SAS to SPSS; variable labels (SAS V8.2, SPSS V10.1, WIN98)

Hi all,

you all know: treading  SAS-datasets into SPSS cuts long variable names
to 8 characters and translates these - if they are not unique - into
shortenings like V24. To see, which original variable was behind this
shortening, I label the SAS-variables in SAS with their original variable
name.

As long as I do the labelling with a datastep and the statement

label <variable>='label';

this works fine and SPSS takes over the labels. When I do it with proc
datasets (which would shorten the
process with large datasets) SPSS will not recognize the labels and sometime
even run into ERROR.

proc datasets;
modify dataset;
label <variable>='label';
run;
quit;

Does anybody know, why this happens and how I can use proc datasets in a way
that SPSS recognizes the labels?

TIA   Albrecht

2. Help:->Palm IIIvx to Startac 7860W

3. Where is PA-RISC spec?

4. SAS/Base: MS Access link to SAS via SAS/ODBC - pulling SAS co lumn labels

5. Notes to Phone dialer connectivity?

6. SAS/Base: MS Access link to SAS via SAS/ODBC - pulling SAS column labels

7. How to create a list with variable names and labels from a SPSS data set

8. SPSS 10 data labels to SAS 8.2

9. SAS data conversion to SPSS with value labels (DBMSCOPY)

10. Format long variable labels in SAS data set

11. Variable labels in v8 of SAS Proc Logistic?