***************Syntax File Follows****************
Comment
Comments in syntax files can be very useful. Begin a Comment with
"Comment" (you can also start with "****") Indenting
each line, as I do, is a nice aesthetic touch to make comments easy
to read. The Comment will continue until you enter a blank line OR
have a period at the end of a line. To clarify, WARNING, a
period at the end of any line in a Comment ends the Comment and any
lines that follow won't be recognized as a Comment - SPSS will treat
them as commands!!
************ I added this to visually end this comment -
not necessary, but pretty.
************
Comment
The following creates a dayofyr variable that tells us on which day of the
year each participant was born - 1-366 (allowing for leap years) -
"bday" in the computation below is the existing variable for which you
entered mm-dd-yyyy. Following the compute is syntax that adds a
useful Variable Label so you can interpret the variable later. The
"execute" statements make things happen.
compute DayofYr=xdate.jdate(bday).
VARIABLE LABELS dayofyr 'Birth Day 1-366'.
EXECUTE .
***********
The following creates a "Season of Birth" variable (Season) - l
abels it and then provides useful Value Labels for the
variable. DayofYr is the variable we created above - were
you to run this syntax BEFORE the syntax above
you would get an error because it wouldn't know what
variable you were talking about.
RECODE
DayofYr
(1 thru 79=4)(357 thru 366=4)(80 thru
171=1)(267 thru 357=3)(172 thru 266=2)
INTO Season .
VARIABLE LABELS Season 'Season of Birth'.
Value labels Season 1 'Spring' 2 'Summer' 3 'Fall' 4 'Winter'.
execute.
***********
The following creates a "Zodiac Sign" (Zodiac) Variable - labels it and
then provides useful Value Labels for the variable.
RECODE
dayofyr
(80 thru 109=1) (110 thru 140=2) (141 thru 171=3) (172 thru 203=4) (204 thru 234=5)
(235 thru 265=6) (266 thru 295=7) (296 thru 325=8) (326 thru 355=9) (356 thru 366=10)
(1 thru 19=10) (20 thru 49=11) (50 thru 79=12) INTO Zodiac .
VARIABLE LABELS Zodiac 'Zodiac Sign'.
Value labels Zodiac 1 'Aries' 2 'Taurus' 3 'Gemini' 4 'Cancer' 5 'Leo' 6 'Virgo' 7 'Libra' 8 'Scorpio' 9
'Sagittarius' 10 'Capricornus' 11 'Aquarius' 12 'Pisces'.
execute.
***********
The following creates a "Liberal Consevative" (LibCon) scale that's
based upon your original PView (Political View) variable. That
variable had more levels than we could use in this scale, so
this Recode only takes the responses 1-5 and "Copy"s
them to the new variable. That is, 1=1, 2=2, 3=3, 4=4, and
5=5. Then we provide useful Value Labels.
RECODE
PView
(1=Copy) (2=Copy) (3=Copy) (4=Copy) (5=Copy) INTO LibCon.
VARIABLE LABELS LibCon 'Liberal Conservative Scale'.
Value labels LibCon 1 'Very Liberal' 2 'Liberal' 3 'Moderate' 4 'Conservative' 5 'Very Conservative'.
execute.
***********
The following creates a "Traditional Political View" (TrView) variable
that indicates whether a person does, or doesn't give a PView response
that falls into the 1-5 scale above. Note that the "ELSE" below
means that ANYTHING else than 1-5 is treated as else - including \
no response at all. So folks that would have had "missing" data above
are now back in the dataset.
RECODE
PView
(1 thru 5=1) (ELSE=0) INTO TrView .
VARIABLE LABELS TrView 'Traditional Political View'.
Value labels TrView 1 'Yes' 0 'No'.
execute.
***********
The following creates a "College 1" (Col1) variable that indicates what
college your first Concentration (Con1) puts you in.
RECODE
Con1
(16=3) (19=3) (21=3) (25=3) (30=3)
(38=3) (40=3) (41=3) (53=3) (54=3)
(57=3) (65=3) (66=3) (69=3) (17=2)
(22=2) (24=2) (32=2) (39=2) (43=2)
(56=2) (1=1) (2=1) (18=1) (20=1) (23=1)
(28=1) (31=1) (42=1) (45=1) (46=1)
(55=1) (70=2) (71=2) (67=2) (68=2)
(3=2) (4=2)
(5=2) (6=2) (7=2) (8=2) (9=2) (10=2) (11=2) (12=2) (13=2) (14=2)
(15=2)
(26=2) (27=2) (34=2) (34 thru 37=2) (37=2) (47=2) (47 thru 52=2)
(47=2)
(58=2) (60=2) (58 thru 60=2) INTO Col1 .
VARIABLE LABELS Col1 'College 1'.
Value labels Col1 1 'KSOM' 2 'CAS' 3 'PCPS' .
EXECUTE .
***********
The following creates a "College 2" (Col2) variable that indicates what
college your second Concentration (Con2) puts you in.
RECODE
Con2
(16=3) (19=3) (21=3) (25=3) (30=3)
(38=3) (40=3) (41=3) (53=3) (54=3)
(57=3) (65=3) (66=3) (69=3) (17=2)
(22=2) (24=2) (32=2) (39=2) (43=2)
(56=2) (1=1) (2=1) (18=1) (20=1) (23=1)
(28=1) (31=1) (42=1) (45=1) (46=1)
(55=1) (70=2) (71=2) (67=2) (68=2)
(15=2) (3 thru
15=2) (26 thru 27=2) (34 thru 37=2)
(47 thru 52=2) (58 thru 60=2) INTO Col2 .
VARIABLE LABELS Col2 'College 2'.
Value labels Col2 1 'KSOM' 2 'CAS' 3 'PCPS'.
EXECUTE .
***********
The creates a "General Education 1" (GE1) variable for CAS majors that indicates
within which GE area their first Concentration lives.
RECODE
Con1
(4=1) (5=1) (7=1) (8=1) (9=1)
(10=1) (52=1) (58=1) (11=2) (3=2)
(27=2)
(32=2) (34=2) (35=2) (37=2) (43=2)
(51=2) (68=2) (70=2) (17=3) (29=3)
(36=3) (59=3) (64=3) (67=3) (56=4)
(71=4) INTO GE1 .
VARIABLE LABELS GE1 'GE Area 1'.
Value labels GE1 1 'Natural Sciences' 2 'Humanities' 3
'Social/Behavioral Science' 4 'Theology/Philosophy'.
EXECUTE .
****************
This creates a "General Education 2" (GE2) variable for CAS majors that indicates
within which GE area their second Concentration lives.
RECODE
Con2
(4=1) (5=1) (7=1) (8=1) (9=1)
(10=1) (52=1) (58=1) (11=2) (3=2)
(27=2)
(32=2) (34=2) (35=2) (37=2) (43=2)
(51=2) (68=2) (70=2) (17=3) (29=3)
(36=3) (59=3) (64=3) (67=3) (56=4)
(71=4) INTO GE2 .
VARIABLE LABELS GE2 'GE Area 2'.
Value labels GE2 1 'Natural Sciences' 2 'Humanities' 3
'Social/Behavioral Science' 4 'Theology/Philosophy' .
EXECUTE .
****************
This creates a "State" (State) variable from Zip codes.
RECODE
Zip
(75502=4) (20799=10) (39901=15)
(20331=29) (71233=36) (6390=47) (73301=59)
(20042=64) (99501 thru 99950=1) (35004
thru 36925=2) (71601 thru 72959=3) (85001 thru
86556=5) (90001 thru 96162=6) (80001 thru 81658=7)
(6001 thru 6389=8)
(6401 thru 6928=8) (20001 thru 20039=10) (20042 thru
20599=10) (19701 thru 19980=13) (32004 thru 34997=14)
(30001 thru
31999=15) (96701 thru 96898=17) (50001 thru
52809=18) (68119 thru 68120=18) (83201 thru 83876=20)
(60001 thru 62999=21)
(46001 thru 47997=22) (66002 thru 67954=23)
(40003 thru 42788=24) (70001 thru 71232=25) (71234 thru
71497=25) (1001
thru 2791=27) (5501 thru 5544=27) (20335 thru
20797=29) (20812 thru 21930=29) (3901 thru 4992=32)
(48001 thru 49971=33)
(55001 thru 56763=34) (63001 thru 65899=35)
(38601 thru 39776=36) (59001 thru 59937=38) (27006 thru
28909=39) (58001
thru 58856=40) (68001 thru 68118=41) (68122 thru
69367=41) (3031 thru 3897=43) (7001 thru 8989=44)
(87001 thru
88441=45) (88901 thru 89883=46) (10001 thru
14975=47) (43001 thru 45999=49) (73001 thru 73199=50)
(73401 thru 74966=50)
(97001 thru 97920=52) (15001 thru 19640=53)
(2801 thru 2940=55) (29001 thru 29948=56) (57001 thru
57799=57) (37010
thru 38589=58) (75001 thru 75501=59) (75503 thru
79999=59) (88510 thru 88589=59) (84001 thru 84784=63)
(20040 thru
20041=64) (20040 thru 20167=64) (22001 thru
24658=64) (5001 thru 5495=68) (5601 thru 5907=68)
(98001 thru 99403=70)
(53001 thru 54990=71) (24701 thru 26886=72) (82001 thru 83128=73) INTO State .
VARIABLE LABELS State 'Home State'.
Value labels State 1 'AK' 2 'AL' 3 'AR' 4 'AR' 5 'AZ' 6 'CA' 7 'CO' 8
'CT' 10 'DC' 13 'DE' 14 'FL' 15 'GA' 17 'HI' 18 'IA' 20 'ID' 21 'IL' 22
'IN' 23 'KS' 24 'KY' 25 'LA' 27 'MA' 29 'MD'
32 'ME' 33 'MI' 34 'MN' 35 'MO' 36 'MS' 38 'MT' 39 'NC' 40 'ND' 41 'NE'
43 'NH' 44 'NJ' 45 'NM' 46 'NV' 47 'NY' 49 'OH' 50 'OK' 52 'OR' 53 'PA'
55 'RI' 56 'SC' 57 'SD' 58 'TN' 59 'TX'
63 'UT' 64 'VA' 68 'VT' 70 'WA' 71 'WI' 72 'WV' 73 'WY' .
EXECUTE .
****************
This creates a "Tri-State Area" (TriSt) variable from State.
RECODE
State
(53=1) (47=2) (44=3) INTO TriSt .
VARIABLE LABELS TriSt 'Tri-State Area'.
Value labels TriSt 1'PA' 2 'NY' 3 'NJ'.
EXECUTE .
************
Enjoy-enjoy.