27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1564 TEMPORARY<br />

Example<br />

• The XSAVE command leaves temporary transformations in effect. SAVE, however, reads the<br />

data and turns temporary transformations off after the file is written. (See example below.)<br />

• TEMPORARY cannot be used with SORT CASES, MATCH FILES, ADD FILES, or COMPUTE<br />

with a LAG function. If any of these commands follows TEMPORARY in the command<br />

sequence, there must be an intervening procedure or command that reads the data to first<br />

execute the TEMPORARY command.<br />

• TEMPORARY cannot be used within the DO IF—END IF or LOOP—END LOOP structures.<br />

SORT CASES BY SEX.<br />

TEMPORARY.<br />

SPLIT FILE BY SEX.<br />

FREQUENCIES VARS=INCOME /STATISTICS=MEDIAN.<br />

FREQUENCIES VARS=INCOME /STATISTICS=MEDIAN.<br />

• SPLIT FILE applies to the first FREQUENCIES procedure, which generates separate median<br />

income tables for men and women.<br />

• SPLIT FILE is not in effect for the second FREQUENCIES procedure, which generates a<br />

single median income table that includes both men and women.<br />

Example<br />

DATA LIST FILE=HUBDATA RECORDS=3<br />

/1 #MOBIRTH #DABIRTH #YRBIRTH 6-11 DEPT88 19.<br />

COMPUTE AGE=($JDATE - YRMODA(#YRBIRTH,#MOBIRTH,#DABIRTH))/365.25.<br />

VARIABLE LABELS AGE ’EMPLOYEE’’S AGE’<br />

DEPT88 ’DEPARTMENT CODE IN 1988’.<br />

TEMPORARY.<br />

RECODE AGE (LO THRU 20=1)(20 THRU 25=2)(25 THRU 30=3)(30 THRU 35=4)<br />

(35 THRU 40=5)(40 THRU 45=6)(45 THRU 50=7)(50 THRU 55=8)<br />

(55 THRU 60=9)(60 THRU 65=10)(65 THRU HI=11).<br />

VARIABLE LABELS AGE ’EMPLOYEE AGE CATEGORIES’.<br />

VALUE LABELS AGE 1 ’Up to 20’ 2 ’20 to 25’ 3 ’25 to 30’ 4 ’30 to 35’<br />

5 ’35 to 40’ 6 ’40 to 45’ 7 ’45 to 50’ 8 ’50 to 55’<br />

9 ’55 to 60’ 10 ’60 to 65’ 11 ’65 and older’.<br />

FREQUENCIES VARIABLES=AGE.<br />

MEANS AGE BY DEPT88.<br />

• COMPUTE creates variable AGE from the dates in the data.<br />

• FREQUENCIES uses the temporary version of variable AGE with temporary variable and<br />

value labels.<br />

• MEANS uses the unrecoded values of AGE and the permanent variable label.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!