SPSS/X 套裝軟體 使用方法介紹

advertisement
SPSS/X 套裝軟體
使用方法介紹
使用時注意事項:
1.
利用 XEDIT 指令建立 SPSS/X 程式檔案,而其檔案形態 (file type) 必得為
SPSSX。
例如:
2.
CRIME SPSSX A1
執行 SPSS/X 時,在 CMS 下鍵入:
USE SPSSX
<----
SPSSX Fn
<----
例如:
USE SPSSX <---SPSSX CRIME
<----
3. 程式執行後,其結果儲存於 Fn LISTING A1 檔案中。
例如:
CRIME LISTING A1
4. 執行 SPSS/X 時,輸入資料 (input data) 可以利用下列三種方式取得:
(a) 資料合併於 SPSS/X 程式之中:
例如:
(利用 BEGIN DATA 與 END DATA 指令)
BEGIN DATA
.
.
END DATA
(b) 資料儲存於 CMS 下之檔案中:
例如:
(應在 SPSS/X 程式中定義此資料檔)
FILE HANDLE CRIMEDAT/NAME='CRIME DATA A1'
DATA LIST FILE=CRIMEDAT
(c) 磁帶資料讀入方式如下:
先向 operator 要求一磁帶機,例用
M OP PLEAST ATTACH TAPE DRIVER
.......
在 TAPE ATTACH 之後,鍵入
FILEDEF 擋名。
例如: CRIMEDAT
最後在 SPSS/X 程式中定義 CRIMEDAT
DATA LIST FILE=CRIMEDAT
5. 欲進入直接互動(interactive)模式 ,可
:
USE SPSSX
SPSSX *
若欲從銀幕中得知 SPSSX 指令寫法,可鍵入 ? keyword 取得。
6. 最後,您必需熟知 CMS 中有關檔案編修 (即 XEDIT 指令)
與系統操作 (例如 FILEL, KERMIT, ERASE 等等) 的技巧。
壹、簡介
The capacities of SPSS/X include:
(1)
input from almost any type of data file.
(2) file management,
including sorting,
splitting,
and
aggregating files, match-merging multiple files, and saving fully
defined system files.
(3) data management,
including sampling and selecting
cases, recoding variables, and creating new variables
using extensive numeric and string functions.
(4) tabulation and statistical analysis - from describing
single variables to performing complex multivariate analyses.
(5)
reporting writing.
範例
程式檔名
GSS SPSSX A1
SET WIDTH = 80
UNNUMBERED
FILE HANDLE GSSDAT/NAME='GSS DATA A1'
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
DATA LIST FILE=GSSDAT RECORDS=1
/1 YEAR 1-2 INCOME 3-4 PRESTIGE 5-6 PAPRES16 7-8 MARITAL 9 SIBS 10-11
ZODIAC 12-13 DEGREE 14 RACE 15 SEX 16 AGE 17-18 CHILDS 19
REGION 20 SIZE 21-24 POLVIEWS 25 PARTYID 26 RELIG 27 ATTEND 28
MAWORK 29 RACLIVE 30 NATENVIR 31 NATEDUC 32 NATFARE 33 NATCRIME 34
NATDRUG 35 CAPPUN 36 GRASS 37 BUSING 38 HAPPY 39 SATFAM 40
SATFRND 41 SATJOB 42 SATFIN 43 CONEDUC 44 CONPRESS 45
CONLEGIS 46 AGED 47 DIVLAW 48 PORNMORL 49 PORNRAPE 50
PORNOUT 51 PORNINF 52 XMOVIE 53 CHLDIDEL 54 HIT 55 HITOK 56
COURTS 57 USINTL 58 POSTLIFE 59 HELPFUL 60
VARIABLE LABELS YEAR 'YEAR OF SAMPLE'
/INCOME 'TOTAL FAMILY INCOME'
/MAWORK 'MOTHER EVER WORK'
/RACLIVE 'BLACK LIVING IN NEIGHBOR'
/NATENVIR 'SPEND $ - ENVIRONMENT'
/NATEDUC 'SPEND $ - EDUCATION'
/NATFARE 'SPEND $ - WELFARE'
/NATCRIME 'SPEND $ - HALTING CRIME RATE'
/NATDRUG 'SPEND $ - DRUG'
/CAPPUN 'DO YOU FAVOR DEATH PENALTY'
/GRASS 'LEGALIZE USE OF MARIJUANA'
/BUSING 'DO YOU FAVOR BUSING'
/HAPPY 'TAKEN ALL TOGETHER ARE YOU HAPPY'
/SATFAM 'SATISFIED WITH FAMILY LIFE'
/SATFRND 'SATISFIED WITH THE FRIENDSHIP'
/SATJOB 'SATISFIED WITH THE WORK YOU DO'
/SATFIN 'SATISFIED WITH FINANCIAL SITUATION'
/CONEDUC 'CONFIDENCE ON EDUCATION'
/CONPRESS 'CONFIDENCE ON PRESS'
/CONLEGIS 'CONFIDENCE ON CONGRESS'
/AGED 'SHARE HOME WITH GROWN CHILDREN'
/DIVLAW 'DIVORCE EASIER NOW'
/PORNMORL 'LEAD TO BREAKDOWN OF MORALS'
/PORNRAPE 'LEAD PEOPLE TO COMMIT RAPE'
/PORNOUT 'PROVIDE OUTLET FOR IMPULSES'
/PORNINF 'PROVIDE INFO ABOUT SEX'
/XMOVIE 'EVER SEEN X-RATED MOVIE'
/CHLDIDEL 'IDEAL NUMBER OF CHILDREN'
/HIT 'EVER BEEN BEATEN BY ANOTHER'
/HITOK 'SITUATION PUNCHING A MALE STRANGER'
/COURTS 'COURT HARSH WITH CRIMINALS'
/USINTL 'TAKE ACTIVE PART IN WORLD AFFAIR'
/POSTLIFE 'BELIEVE LIFE AFTER DEATH'
/HELPFUL 'PEOPLE TRY TO BE HELPFUL'
VALUE LABELS INCOME 1 'UNDER 1,000' 2 '1,000 - 2,999' 3 '3,000 - 3,999'
4 '4,000 - 4,999' 5 '5,000 - 5,999' 6 '6,000 - 6,999' 7 '7,000 - 7,999'
8 '8,000 - 9,999' 9 '10,000 - 14,999' 10 '15,000 - 19,999'
11 '20,000 - 24,999' 12 '25,000 OR OVER' 13 'REFUSED' 98 'DK' 99 'NA'
/MARITAL 1 'MARRIED' 2 'WIDOWED' 3 'DIVORCED' 4 'SEPARATED'
5 'NEVER MARRIED' 9 'NA'
/SIBS 98 'DK' 99 'NA'
/DEGREE 1 'HIGH SCHOOL' 2 'JUNIOR COLLEGE' 3 'BACHELOR' 4 'GRADUATE'
8 'DK' 9 'NA'
/RACE 1 'WHITE' 2 'BLACK' 3 'OTHER'
/SEX 1 'MALE' 2 'FEMALE'
/AGE 99 'NA OR DK'
/CHILDS 8 'EIGHT OR MORE' 9 'NA'
/REGION 1 'NEW ENGLAND' 2 'MIDDLE ATLANTIC' 3 'EAST NORTH CENTRAL'
4 'WEST NORTH CENTRAL' 5 'SOUTH ATLANTIC' 6 'EAST SOUTH CENTRAL'
7 'WEST SOUGH CENTRAL' 8 'MOUNTAIN' 9 'PACIFIC'
/SIZE 0 'LESS THAN 1,000'
/POLVIEWS 1 'EXTREMELY LIBERAL' 2 'LIBERAL' 3 'SLIGHT LIBERAL'
4 'MODERATE' 5 'SLIGHT CONSERVATIVE' 6 'CONSERVATIVE'
7 'EXTREMELY CONVEVATIVE' 8 'DK' 9 'NA'
/PARTYID 0 'STRONG DEMOCRAT' 1 'NOT STRONG DEMOCRAT' 2 'INDEPENDENT - DEMO'
3 'INDEPENDENT' 4 'INDEPENDENT - REP' 5 'NOT STRONG REPUBLIC'
6 'STRONG REPUBLIC' 7 'OTHER PARTY' 8 'DK' 9 'NA'
/RELIG 1 'PROTESTANT' 2 'CATHOLIC' 3 'JEWISH' 4 'NONE' 5 'OTHER' 9 'NA'
/ATTEND 0 'NEVER' 1 '< ONCE A YEAR' 2 'TWICE A YEAR' 3 'SEVERAL A YEAR'
4 'ONCE A MONTH' 5 '2-3 TIMES A MONTH' 6 'NEARLY EVERY WEEK'
7 'EVERY WEEK' 8 'SEVERAL A WEEK' 9 'DK OR NA'
/MAWORK RACLIVE 1 'YES' 2 'NO' 8 'DK' 9 'NA' 0 'NA'
/NATENVIR TO NATDRUG 1 'TOO LITTLE' 2 'ABOUT RIGHT' 3 'TOO MUCH' 8 'DK'
/CAPPUN BUSING 1 'FAVOR' 2 'OPPOSE' 8 'DK' 9 'NA'
/GRASS 1 'SHOULD' 2 'SHOULD NOT' 8 'DK' 9 'NA'
/HAPPY 1 'VERY HAPPY' 2 'PRETTY HAPPY' 3 'NOT TOO HAPPY' 8 'DK' 9 'NA'
/SATFAM 1 'VERY GREAT DEAL' 2 'GREAT DEAL' 3 'QUITE A BIT'
4 'FAIR AMOUNT' 5 'SOME' 6 'A LITTLE' 7 'NONE' 8 'DK' 9 'NA'
/SATJOB 1 'VERY SATISFIED' 2 'MODERATE SATISFIED' 3 'LITTLE DISSATISFIED'
8 'DK' 9 'NA'
/SATFIN 1 'PRETTY SATISFIED' 2 'MORE OR LESS' 3 'NOT SATISFIED' 8 'DK'
9 'NA'
/CONEDUC TO CONLEGIS 1 'A GREAT DEAL' 2 'SOME' 3 'HARDLY ANY' 8 'DK' 9 'NA'
/AGED 1 'A GOOD IDEA' 2 'BAD IDEA' 3 'DEPENDS' 8 'DK' 9 'NA'
/DIVLAW 1 'EASIER' 2 'MORE DIFFICULT' 3 ' STAY AS IS' 8 'DK' 9 'NA'
/PORNMORL TO PORNINF XMOVIE 1 'YES' 2 'NO' 8 'DK' 9 'NA'
/CHLDIDEL 7 '7 OR MORE' 8 'AS MANY AS YOU WANT' 9 'DK OR NA'
/HIT 1 'YES' 2 'NO' 8 'DK' 9 'NA'
/HITOK 1 'YES' 2 'NO' 8 'NOT SURE' 9 'NA'
/COURTS 1 'TOO HARSHLY' 2 'NOT HARSHLY ENOUGH' 3 'ABOUT RIGHT' 8 'DK' 9 'NA'
/USINTL 1 'ACTIVE PART' 2 'STAY OUT' 8 'DK' 9 'NA'
/POSTLIFE 1 'YES' 2 'NO' 8 'UNDECIDED' 9 'NA'
/HELPFUL 1 'TRY TO BE HELPFUL' 2 'LOOK OUT FOR SELF' 3 'DEPENDS'
8 'DK' 9 'NA'
MISSING VALUES MARITAL DEGREE CHILDS POLVIEWS PARTYID MAWORK RACLIVE
TO XMOVIE HIT TO HELPFUL (8,9)
MISSING VALUES RELIG ATTEND CHLDIDEL (9)
MISSING VALUES INCOME SIBS AGE (98,99)
FREQUENCIES VARIABLES=CAPPUN/STATISTICS=DEFAULT
SAVE OUTFILE=GSSSYS
FINISH
結果檔名
4-Apr-90
20:52:27
GSS LISTING A1
SPSS-X RELEASE 3.1 FOR IBM VM/CMS
Ministry of Education (MOE)
IBM
3090-120E
For VM/CMS R5.0
Ministry of Education (MOE)
This software is functional through December 31, 1990.
VM/CMS
R5.0
License Number 61597
Try the new SPSS-X Release 3.1 features:
* Interactive SPSS-X command execution
* Online Help
* Nonlinear Regression
* Time Series and Forecasting (TRENDS)
* Macro Facility
1
2
3
0 SET WIDTH = 80
0
UNNUMBERED
4
5
6
FILE HANDLE GSSDAT/NAME='GSS DATA A1'
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
7
8
9
10
11
12
13
* The new RANK
* Improvements
*
REPORT and
*
Simplified
*
Matrix I/O
procedure
in:
TABLES
Syntax
DATA LIST FILE=GSSDAT RECORDS=1
/1 YEAR 1-2 INCOME 3-4 PRESTIGE 5-6 PAPRES16 7-8 MARITAL 9 SIBS 10-11
ZODIAC 12-13 DEGREE 14 RACE 15 SEX 16 AGE 17-18 CHILDS 19
REGION 20 SIZE 21-24 POLVIEWS 25 PARTYID 26 RELIG 27 ATTEND 28
MAWORK 29 RACLIVE 30 NATENVIR 31 NATEDUC 32 NATFARE 33 NATCRIME 34
NATDRUG 35 CAPPUN 36 GRASS 37 BUSING 38 HAPPY 39 SATFAM 40
14
SATFRND 41 SATJOB 42 SATFIN 43 CONEDUC 44 CONPRESS 45
15
CONLEGIS 46 AGED 47 DIVLAW 48 PORNMORL 49 PORNRAPE 50
16
PORNOUT 51 PORNINF 52 XMOVIE 53 CHLDIDEL 54 HIT 55 HITOK 56
17
COURTS 57 USINTL 58 POSTLIFE 59 HELPFUL 60
18
This command will read 1 records from GSS DATA A1
Variable
Rec
Start
End
Format
YEAR
1
1
2
F2.0
INCOME
PRESTIGE
PAPRES16
MARITAL
SIBS
ZODIAC
DEGREE
RACE
1
1
1
1
1
1
1
1
3
5
7
9
10
12
14
15
4
6
8
9
11
13
14
15
F2.0
F2.0
F2.0
F1.0
F2.0
F2.0
F1.0
F1.0
SEX
1
16
16
F1.0
AGE
CHILDS
REGION
SIZE
POLVIEWS
PARTYID
RELIG
ATTEND
MAWORK
RACLIVE
1
1
1
1
1
1
1
1
1
1
17
19
20
21
25
26
27
28
29
30
18
19
20
24
25
26
27
28
29
30
F2.0
F1.0
F1.0
F4.0
F1.0
F1.0
F1.0
F1.0
F1.0
F1.0
NATENVIR
NATEDUC
NATFARE
1
1
1
31
32
33
31
32
33
F1.0
F1.0
F1.0
NATCRIME
NATDRUG
CAPPUN
GRASS
BUSING
HAPPY
SATFAM
1
1
1
1
1
1
1
34
35
36
37
38
39
40
34
35
36
37
38
39
40
F1.0
F1.0
F1.0
F1.0
F1.0
F1.0
F1.0
SATFRND
SATJOB
SATFIN
CONEDUC
CONPRESS
CONLEGIS
AGED
DIVLAW
PORNMORL
1
1
1
1
1
1
1
1
1
41
42
43
44
45
46
47
48
49
41
42
43
44
45
46
47
48
49
F1.0
F1.0
F1.0
F1.0
F1.0
F1.0
F1.0
F1.0
F1.0
PORNRAPE
PORNOUT
PORNINF
XMOVIE
CHLDIDEL
HIT
HITOK
COURTS
1
1
1
1
1
1
1
1
50
51
52
53
54
55
56
57
50
51
52
53
54
55
56
57
F1.0
F1.0
F1.0
F1.0
F1.0
F1.0
F1.0
F1.0
USINTL
1
58
58
F1.0
POSTLIFE
HELPFUL
1
1
59
60
59
60
F1.0
F1.0
19
20
21
22
23
24
25
VARIABLE LABELS YEAR 'YEAR OF SAMPLE'
/INCOME 'TOTAL FAMILY INCOME'
/MAWORK 'MOTHER EVER WORK'
/RACLIVE 'BLACK LIVING IN NEIGHBOR'
/NATENVIR 'SPEND $ - ENVIRONMENT'
/NATEDUC 'SPEND $ - EDUCATION'
/NATFARE 'SPEND $ - WELFARE'
26
27
28
/NATCRIME 'SPEND $ - HALTING CRIME RATE'
/NATDRUG 'SPEND $ - DRUG'
/CAPPUN 'DO YOU FAVOR DEATH PENALTY'
29
30
31
32
33
34
35
/GRASS 'LEGALIZE USE OF MARIJUANA'
/BUSING 'DO YOU FAVOR BUSING'
/HAPPY 'TAKEN ALL TOGETHER ARE YOU HAPPY'
/SATFAM 'SATISFIED WITH FAMILY LIFE'
/SATFRND 'SATISFIED WITH THE FRIENDSHIP'
/SATJOB 'SATISFIED WITH THE WORK YOU DO'
/SATFIN 'SATISFIED WITH FINANCIAL SITUATION'
36
37
38
39
40
41
42
43
44
/CONEDUC 'CONFIDENCE ON EDUCATION'
/CONPRESS 'CONFIDENCE ON PRESS'
/CONLEGIS 'CONFIDENCE ON CONGRESS'
/AGED 'SHARE HOME WITH GROWN CHILDREN'
/DIVLAW 'DIVORCE EASIER NOW'
/PORNMORL 'LEAD TO BREAKDOWN OF MORALS'
/PORNRAPE 'LEAD PEOPLE TO COMMIT RAPE'
/PORNOUT 'PROVIDE OUTLET FOR IMPULSES'
/PORNINF 'PROVIDE INFO ABOUT SEX'
45
46
47
48
49
50
51
52
/XMOVIE 'EVER SEEN X-RATED MOVIE'
/CHLDIDEL 'IDEAL NUMBER OF CHILDREN'
/HIT 'EVER BEEN BEATEN BY ANOTHER'
/HITOK 'SITUATION PUNCHING A MALE STRANGER'
/COURTS 'COURT HARSH WITH CRIMINALS'
/USINTL 'TAKE ACTIVE PART IN WORLD AFFAIR'
/POSTLIFE 'BELIEVE LIFE AFTER DEATH'
/HELPFUL 'PEOPLE TRY TO BE HELPFUL'
53
54
55
56
57
58
59
60
61
62
63
VALUE LABELS INCOME 1 'UNDER 1,000' 2 '1,000 - 2,999' 3 '3,000 - 3,999'
4 '4,000 - 4,999' 5 '5,000 - 5,999' 6 '6,000 - 6,999' 7 '7,000 - 7,999'
8 '8,000 - 9,999' 9 '10,000 - 14,999' 10 '15,000 - 19,999'
11 '20,000 - 24,999' 12 '25,000 OR OVER' 13 'REFUSED' 98 'DK' 99 'NA'
/MARITAL 1 'MARRIED' 2 'WIDOWED' 3 'DIVORCED' 4 'SEPARATED'
5 'NEVER MARRIED' 9 'NA'
/SIBS 98 'DK' 99 'NA'
/DEGREE 1 'HIGH SCHOOL' 2 'JUNIOR COLLEGE' 3 'BACHELOR' 4 'GRADUATE'
8 'DK' 9 'NA'
/RACE 1 'WHITE' 2 'BLACK' 3 'OTHER'
64
65
66
/SEX 1 'MALE' 2 'FEMALE'
/AGE 99 'NA OR DK'
/CHILDS 8 'EIGHT OR MORE' 9 'NA'
67
68
69
70
71
72
73
/REGION 1 'NEW ENGLAND' 2 'MIDDLE ATLANTIC' 3 'EAST NORTH CENTRAL'
4 'WEST NORTH CENTRAL' 5 'SOUTH ATLANTIC' 6 'EAST SOUTH CENTRAL'
7 'WEST SOUGH CENTRAL' 8 'MOUNTAIN' 9 'PACIFIC'
/SIZE 0 'LESS THAN 1,000'
/POLVIEWS 1 'EXTREMELY LIBERAL' 2 'LIBERAL' 3 'SLIGHT LIBERAL'
4 'MODERATE' 5 'SLIGHT CONSERVATIVE' 6 'CONSERVATIVE'
7 'EXTREMELY CONVEVATIVE' 8 'DK' 9 'NA'
74
75
76
77
78
79
80
81
82
/PARTYID 0 'STRONG DEMOCRAT' 1 'NOT STRONG DEMOCRAT' 2 'INDEPENDENT - DE
3 'INDEPENDENT' 4 'INDEPENDENT - REP' 5 'NOT STRONG REPUBLIC'
6 'STRONG REPUBLIC' 7 'OTHER PARTY' 8 'DK' 9 'NA'
/RELIG 1 'PROTESTANT' 2 'CATHOLIC' 3 'JEWISH' 4 'NONE' 5 'OTHER' 9 'NA'
/ATTEND 0 'NEVER' 1 '< ONCE A YEAR' 2 'TWICE A YEAR' 3 'SEVERAL A YEAR'
4 'ONCE A MONTH' 5 '2-3 TIMES A MONTH' 6 'NEARLY EVERY WEEK'
7 'EVERY WEEK' 8 'SEVERAL A WEEK' 9 'DK OR NA'
/MAWORK RACLIVE 1 'YES' 2 'NO' 8 'DK' 9 'NA' 0 'NA'
/NATENVIR TO NATDRUG 1 'TOO LITTLE' 2 'ABOUT RIGHT' 3 'TOO MUCH' 8 'DK'
83
84
85
86
87
88
89
90
/CAPPUN BUSING 1 'FAVOR' 2 'OPPOSE' 8 'DK' 9 'NA'
/GRASS 1 'SHOULD' 2 'SHOULD NOT' 8 'DK' 9 'NA'
/HAPPY 1 'VERY HAPPY' 2 'PRETTY HAPPY' 3 'NOT TOO HAPPY' 8 'DK' 9 'NA'
/SATFAM 1 'VERY GREAT DEAL' 2 'GREAT DEAL' 3 'QUITE A BIT'
4 'FAIR AMOUNT' 5 'SOME' 6 'A LITTLE' 7 'NONE' 8 'DK' 9 'NA'
/SATJOB 1 'VERY SATISFIED' 2 'MODERATE SATISFIED' 3 'LITTLE DISSATISFIED
8 'DK' 9 'NA'
/SATFIN 1 'PRETTY SATISFIED' 2 'MORE OR LESS' 3 'NOT SATISFIED' 8 'DK'
91
9 'NA'
92
93
94
95
96
97
98
99
100
101
/CONEDUC TO CONLEGIS 1 'A GREAT DEAL' 2 'SOME' 3 'HARDLY ANY' 8 'DK' 9 '
/AGED 1 'A GOOD IDEA' 2 'BAD IDEA' 3 'DEPENDS' 8 'DK' 9 'NA'
/DIVLAW 1 'EASIER' 2 'MORE DIFFICULT' 3 ' STAY AS IS' 8 'DK' 9 'NA'
/PORNMORL TO PORNINF XMOVIE 1 'YES' 2 'NO' 8 'DK' 9 'NA'
/CHLDIDEL 7 '7 OR MORE' 8 'AS MANY AS YOU WANT' 9 'DK OR NA'
/HIT 1 'YES' 2 'NO' 8 'DK' 9 'NA'
/HITOK 1 'YES' 2 'NO' 8 'NOT SURE' 9 'NA'
/COURTS 1 'TOO HARSHLY' 2 'NOT HARSHLY ENOUGH' 3 'ABOUT RIGHT' 8 'DK' 9
/USINTL 1 'ACTIVE PART' 2 'STAY OUT' 8 'DK' 9 'NA'
/POSTLIFE 1 'YES' 2 'NO' 8 'UNDECIDED' 9 'NA'
102
103
104
/HELPFUL 1 'TRY TO BE HELPFUL' 2 'LOOK OUT FOR SELF' 3 'DEPENDS'
8 'DK' 9 'NA'
105
106
107
108
109
110
111
MISSING VALUES MARITAL DEGREE CHILDS POLVIEWS PARTYID MAWORK RACLIVE
TO XMOVIE HIT TO HELPFUL (8,9)
MISSING VALUES RELIG ATTEND CHLDIDEL (9)
MISSING VALUES INCOME SIBS AGE (98,99)
FREQUENCIES VARIABLES=CAPPUN/STATISTICS=DEFAULT
CAPPUN
DO YOU FAVOR DEATH PENALTY
Value Label
Value
FAVOR
OPPOSE
DK
1
2
8
NA
9
Total
Mean
Maximum
Valid cases
1.273
2.000
946
Frequency
688
258
51
3
------1000
Std dev
Missing cases
.446
54
Percent
Valid
Percent
Cum
Percent
68.8
25.8
5.1
72.7
27.3
Missing
72.7
100.0
.3
Missing
------- ------100.0
100.0
Minimum
1.000
112 SAVE OUTFILE=GSSSYS
113
1,000 cases saved
114
FINISH
系統檔名
GSS SYS A1
SPSS/X 使用的檔案
(1)
command file (one per job) - contains SPSSx commands.
(2) input data file - contains your data in almost any format.
It can be within your SPSSx command file, or it can be a separate
file on tape or disk.
(3) display file - contains tabular output from
procedures, output from any PRINT or WRITE commands.
(4) output
computer.
file
- contains data formatted to be
the
read
SPSSx
by
a
(5) SPSSx system file - A file formatted for use by SPSSx. It
contains both data and the dictionary that defines the data to
the system.
貳、 SPSS/X 語言
Every SPSSx command begins in column 1 of a command line and
continues for as many lines as needed.
All continuation lines are indented at least one column.
The
maximum
characters.
length
of
an
input
line
is
usually
80
Enter commands in any case you wish. (upper or lower)
* Names - Both in defining data and in creating variables
through COMPUTE, IF, RECODE, COUNT you assign names to your
variables.
No longer than 8 characters.
Begin with one of the 26 letters A - Z or with @, #, or $.
#NAME - scratch variable, used for convenience in defining
the file or in transforming the data.
Not available in
procedures and are not saved on system files.
* TO conventions - refer to a set of variable names by TO.
Ex.
ITEM1
ITEM5.
TO
ITEM5 is equivalent to ITEM1 ITEM2
X01 TO X9 is not valid.
ITEM4
X01 TO X09 is acceptable.
XA TO XD - refers to XA XD and any
between XA and XD on the active file.
* 關鍵字 (Keywords)
names.
ITEM3
- reserved keywords:
variables
that
fall
do not use them as variable
ALL
AND
BY
EQ
GE
GT
LE
LT
NE
NOT TO
OR
WITH
THRU
* 數值與文字 (Numbers and Literals)
- values of variables.
* Arithmetic operators and delimiters +
-
*
/
Six Types of Commands
=
* utility commands - EDIT, FILE HANDLE, FILE LABEL, FINISH,
INFO, INPUT MATRIX, N OF CASES, NUMBERED, UNNUMBERED, PROCEDURE
OUTPUT, SET, SHOW, TITLE, SUBTITLE
* File definition commands - ADD FILES, DATA LIST,
TYPE, GET, GET SCSS, IMPORT, INPUT PROGRAM, MATCH FILES
FILE
* input program commands - END CASE, END FILE, END FILE
TYPE, END INPUT PROGRAM, RECORD TYPE, REPEATING DATA, REREAD
* transformation commands - COMPUTE, COUNT, DISPLAY, DO IF
- END IF, DO REPEAT - END REPEAT, DOCUMENT, FORMATS, IF, LEAVE,
LOOP - END LOOP, BREAK, MISSING VALUES, NUMERIC, PRINT, PRINT
EJECT, PRINT FORMATS, PRINT SPACE, RECODE, SPLIT FILE, STRING,
VALUE LABELS, VARIABLE LABELS, VECTOR, WEIGHT, WRITE, WRITE
FORMATS
* restricted transformations - REFORMAT,
TEMPORARY
SAMPLE, SELECT IF,
* procedures - BEGIN DATA, EXECUTE, EXPORT, LIST, SAVE, SAVE
SCSS, SORT CASES, procedures
Order of Commands
initial state ---> input program state
---> procedure state ---> finish
---> transformation state
Initial state - Each SPSSx job starts in the initial state.
Input program state - enables to read data.
Transformation state - allows data modifications.
Procedure state - enables to begin executing a procedure.
A
variable must be defined before it or its values
can
be
labeled.
Subcommands must be separated by slashes (/).
STATISTICS and OPTIONS
after the procedure command.
commands must
follow
immediately
SELECT IF command works only after the cases are created.
COMPUTE
command
is used both to create and
cases and can appear in either program.
to
transforma
參、資料定義 (Data Definition)
File
definition
provides basic information about the
data
file.
Variable definition provides specific information about
location, structure, and meaning of the data on the file.
the
Define the file on the FILE HANDLE and DATA LIST commands.
Define the variables beginning on the DATA LIST command and
continuing on optional variable definition commands such as
VARIABLE LABELS, MISSING VALUES, and so forth.
FILE HANDLE
FILE HANDLE POLICE/NAME='COPDATA'
- no longer than 8 characters.
- no embedded blanks are allowed.
- note: In the IBM/OS, FILE HANDLE command is not used.
//POLICE DD DSN=ACAD.SOCHOU.POLICE.DATA
is used.
DATA LIST
DATA LIST does not read the data; it gives SPSSx information
on the location and format of the data.
Data are read when a procedure or other data reading command
is executed.
Once SPSSx reads your data,
it creates an active file which
consists
of
the
data
and
a
dictionary
containing
variable
definitions.
The active file is the file that you can
and save as a system file.
Once SPSSx has an active file,
file handle on other commands.
*** FILE ***
Exam.
modify,
analyze,
refer to it with * as
the
FILE HANDLE HUBDATA/NAME = 'DATA'
DATA LIST FILE=HUBDATA RECORDS=3
/1 YRHIRED 14 - 15 DEPT82 19 SEX 20
* It indicates that file HUBDATA is being described.
***
FIXED, FREE, LIST
***
Use one of the following keywords to indicate the format
the data:
of
FIXED - fixed format data. Each variable is recorded in the
same location on the same record for each case in the data.
FIXED is the default.
FREE - freefield format data. You can enter multiple cases
on the same record with each value separated by one or more
blanks.
LIST - freefield data with one case on each record.
Exam.
DATA LIST FILE=HUBDATA FIXED RECORDS=3
/1 YRHIRED 14 - 15 DEPT82 19 SEX 20
*** RECORDS
***
It is to specify the number of records per case.
In the above example, SPSSx expects three records per case.
* By default,
format data.
***
/
***
SPSSx assumes one record per case for
fixed
/ is used to specify the number of the record.
***
naming the variables
***
Variable names have a maximum length of 8 characters.
The first of which must be an alphabetic letter or @ # or $.
A $ indicates the variable is a system variable.
System variables can not be named on the DATA LIST and
not available for procedures.
are
***
indicating column locations
***
If the variable is one column wide,
the column.
specify the number
of
If the variable is two or more columns wide, specify the
number of the first column followed by a dash ( - ) and the
number of the last column.
Exam.
/ 1 YRHIRED 14 - 15 DEPT82 19 SEX 20
*** specifying multiple records
**
You enter a slash, followed by the record number of the next
record to be read.
Exam.
/5 V1 1 - 5
* V1 is located on the fifth record of the data file.
*** specifying multiple variables ***
Exam.
/1 V2 V3 V5 V6 TO V8 1 - 7
* TO is allowed.
Exam.
V01 TO V9
*
This is not allowed.
*** indicating decimal places
Exam.
**
/2 SALARY 42 - 46 (2)
* SALARY is stored as decimal positions,
from columns 42 to
46.
If the data value is 32090, the true value is 320.90.
*** string variable ***
It is also known as character varible.
The format type specification for a string variabgle is the
letter
A
enclosed in parentheses
following
the
column
specification.
Exam.
/3 NAME 25 - 48 (A)
* Name is 24 character variable.
** FREE, LIST
**
Exam.
DATA LIST FILE=WINS FREE/POSTPOS NWINS
data:
2 19 7 5 10 25 5 17 8 11 3 18 6 8 1 29
* The first cast is 2 and 19;
and so forth.
Exam.
7 and 5 for the second case,
DATA LIST FILE=WINS LIST/POSTPOS NWINS
data
2 19
7 5
10 25
5 17
8 11
3
18
6 8
1 29
* It reads the same value as in FREE format.
MISSING VALUES
Exam.
MISSING VALUES COLOR (8,9)
* This command
variable COLOR.
You can
variable.
You
names 8 and 9 as
the
missing
value
specify a maximum of 3 individual values for
separate the missing values from each other by a
for
each
comma
or blank.
Exam.
RECODE AGE (0 THRU 18 = 0)
MISSING VALUES AGE (0)
* It is to declare a large number of values as missing.
or you can:
MISSING VALUES AGE (0 THRU 18)
** MISSING VALUES for string variables **
MISSING VALUES STRING1 ('X','Y')
* It is to specify the values X and Y as missing.
* values ranges can not be specified for string variables.
VARIABLE and VALUE LABELS
VARIABLE
your file.
LABELS
commands to assign labels to variables
in
One or more VALUE LABELS commands to assign labels to values
of variables.
SPSSx displays these variable and value labels on the output
produced by the procedures and saves them in the dictionary of
the active file.
Exam.
VARIABLE LABELS SALARY 'EMPLOYEE''S SALARY'
or you can:
VARIABLE LABELS SALARY ''EMPLOYEE'S SALARY""
Note:
A variable label applies to only one variable.
The variable must have been defined.
Each variable label can be up to 40 characters long.
Exam.
VALUE LABELS DEPT 0 'NOT REPORTED' 1 'ADMINISTRATIVE'
2 'PROJECT DIRECTORS' 3 'CHICAGO OPERATIONS'
* Assigns labels to the values 0, 1, 2, and 3 of DEPT.
You can assign labels to values of any defined variable.
Enclosed each value in apostrophes or quotation marks.
Value labels can not exceed 20 characters.
肆、工作設備 (Job Utilities)
The following commands allow you to control some of the
general characteristics of your output and of the environment
under which your job is processed.
TITLE
The heading includes the date, a title, and the page number
at the top of each page in the display file.
The title can be up to 60 characters long and can
any characters valid on computer.
Exam.
contain
TITLE "Running Shoe Study from Runner's World Data"
TITLE 'Running Shoe Study from Runner''s World Data'
Both are acceptable.
SUBTITLE
It prints on the line immediately under the title.
Blank if SUBTITLE command is not used.
TITLE and SUBTITLE are independent.
COMMENT
It help you and others review what you intend to accomplish
with individual commands and blocks of commands within an SPSSx
job.
It does not become part of the information saved on a system
file.
Two ways to insert comments:
(1) By using COMMENT command;
The COMMENT message can
continued on any many lines as necessary.
Exam.
be
COMMENT compute social economic status variable
(2) By enclosing the comment within the symbols /* and */ in
any command line.
The /* and */ cannot be continued on the next
line.
Exam.
IF (RACE EQ 1 AND SEX EQ 1) SEXRACE = 1 /*WHITE MALE
FINISH
The FINISH command terminates an SPSSx job.
computer to stop reading commands.
Exam.
It causes
the
FINISH
NUMBERED (UNNUMBERED)
The NUMBERED command instructs SPSSx to check just the first
72 columns for command specifications.
The
UNNUMBERED
command
instructs SPSSx to
check
all
80
columns.
Exam.
NUMBERED
or
UNNUMBERED
SET and SHOW
SET allows you to choose optional treatments of data on
input, properties of the display file, compression of scratch
files, the starting point for random number generation, and so
on.
Exam.
SET BLANKS = 0 /UNDEFINED = NOWARN /MXWARNS=200
SHOW displays the current settings of those options as well
as additional information about the values of system variables,
the system missing value, ;the variable used to weight cases, and
the number of cases currently in the active file.
Exam.
SHOW BLANKS/UNDEFINED/MXWARNS
伍、數值轉換 (Numeric Transformations)
The ability to transform data before you analyze it. You may
want to perform simple data cleaning checks, correct coding
errors, or adjust an inconvenient coding scheme. Or you may want
to construct an index from several variables or rescale several
variables prior to analysis.
RECODE
It changes the coding scheme of an existing variable on
value by value basis or for ranges of values.
Exam.
a
RECODE ITEM1, ITEM2 TO ITEM5 (5=1)(4=2)(2=4)(1=5)
RECODE ATTITUDE (1,2=1)(3,4=2)(5,6=3)(7,8=4)(9,10=5)
RECODE AGE (LOWEST THRU 20=1)(21 THRU 45=2)(46 THRU
60=3)(60 THRU HIGHEST=4)
Several keyword available for recoding numeric variables.
THRU - to specify value ranges
(0 THRU 99)
LOWEST, HIGHEST - to specify the lowest and highest values.
RECODE AGE (LO THRU 20=1) (65 THRU HI=4)
ELSE - to recode all values not mentioned.
RECODE AGE (LO THRU 17=1)(ELSE=2)
MISSING, SYSMIS - MISSING to reference missing values on
input; SYSMIS to reference missing values on both input and
output.
RECODE AGE (MISSING=9)
RECODE AGE (MISSING=SYSMIS)
INTO - to create a new variable as a recoded version of
old one.
an
RECODE AGE (MISSING=9)(18 THRU 110=1)(0 THRU 18=0)
(ELSE=8) INTO VOTER
VOTER is a new variable, taking 0, 1, and 8 as the values.
AGE is unchanged.
COMPUTE
COMPUTE command is to create a new variable or transform an
existing variable using information from other variables on your
file.
Exam.
COMPUTE INCOME=WAGES+BONUS+INTEREST+OTHERINC
** Assigns the sum of four existing variables to
INCOME for each case.
variable
COMPUTE SCALE = MEAN (ITEM1, ITEM2, ITEM3)
** Constructs variable SCALE from three variables using
MEAN function.
the
Arithmetic Functions
(92)
Exam.
COMPUTE INCOME=TRUNC (INCOME)
COMPUTE FACTOR = SUM (SCORE1 TO SCORE3)
**
instructs
missing otherwise.
to
sum
three valid scores
and
COMPUTE FACTOR = SUM.2 (SCORE 1 TO SCORE3)
to
return
** instructs SPSSx to sum any two or more valid scores,
and
to return missing otherwise.
Using Logical Functions - are useful short cuts to more
complicate specifications on the IF, DO IF, and other conditional
commands.
Exam.
IF ANY (DEPT82,1,2) BONUS = .16*SALARY82
equivalent to:
IF (DEPT82 EQ 1 OR DEPT82 EQ 2) BONUS = .16*SALARY82
COMPUTE WORKERS = RANGE (AGE,18,65)
equivalent to:
IF (AGE GE 18 AND AGE LE 65) WORKERS= 1
IF (AGE LT 18 OR AGE GT 65) WORKERS = 0
COMPUTE ELIGIBLE = AGE GE 18
** ELIGIBLE takes 0 and 1; 1 for those 18 or older and 0 for
those under 18.
COUNT
It counts the occurrences of the same value (or
values) across a list of numeric or string variables.
Exam.
list
of
COUNT READER=NEWSWEEK, TIME, USNEWS (2)
** creates a simple index READER that indicates the number
of times the value 2 is recorded for the three variables for a
case.
The values of READER will be 0, 1, 2, or 3.
TEMPORARY
It is to signal the beginning of temporary
that are in effect only for the next procedure.
transformations
New numeric or string variables created after the
command are temporary variables.
TEMPORARY
Any modifications after the command are also temporary.
Exam.
TEMPORARY
RECODE AGE (LO THRU 20=1)(21 THRU 25=2)(26 THRU 30=3)
(31 THRU HI=11)
VARIABLE LABELS AGE 'EMPLOYEE AGE CATEGORIES'
VALUE LABELS AGE 1 'UP TO 20' 2 '20 TO 25'
FREQUENCIES VARIABLES=AGE
BREAKDOWN AGE BY DEPT82
陸、字串轉換 (String Transformations)
You can manipulate string variables in SPSSx using most of
the same commands described in Chapter 5. However, you cannot
treat strings with a full range of mathematical operatiosn and
functions.
A string variable must be declared before it can be used
a target variable in data transformations
as
RECODE
It
is
to change one code for a variable to another as
the
data are being read.
Exam.
RECODE STATE ('IO' = 'IA')
** Change all cases coded IO to IA.
** must be enclosed in apostrophes.
Exam.
RECODE STATE ('IO', 'IW' = 'IA')
Exam.
RECODE STATE ('IO'='IA')/Q1 TO Q5 ('X'='Y')('A'='B')
Exam.
STRING STATE1 (A2)
RECODE STATE ('IO'='IA')(ELSE=COPY) INTO STATE1
* use STRIMG to declare a new variable;
* ELSE and COPY are used to copy the other state codes over
unchanged.
* variables STATE and STATE1 are identical except for
with original input value IO.
Exam.
RECODE SEX ('M'=1)('F'=2) INTO NSEX
cases
*
It
recodes
SEX from a string variable
variable called NSEX.
SELECT IF
Exam.
SELECT IF STATE EQ 'IL'
COMPUTE
Exam.
STRING S(A2)
COMPUTE S='NA'
into
a
numeric
* It declares string variable S with a length of 2
characters and compute sets S to the literal NA for every case.
Exam.
STRIMG DRUG (A)
COMPUTE DRUG='A'
* Drug is assigned a value of A for every case.
String Functions:
Exam.
STRING SSNUMBER (ALL)
COMPUTE SSNUMBER = CONCAT (SS1,'-',SS2,'-',SS3)
* It joins the three portions of a social security
and separating these portions with hyphens.
(Pp. 116 - 117 String Functions here)
number
柒、條件轉換 (Conditional Transformations)
You may want to construct or alter variables one way for one
subset of cases and other ways for other subsets.
The IF Command
The IF command makes COMPUTE like transformations contingent
upon logical conditions found in the data.
The IF command is
followed by a logical expression.
Exam.
IF (X EQ 0) Y = 1
* assign the value 1 to variable Y only for cases with value
0 for X.
The DO IF
Exam.
-
END IF Structure
DO IF (X EQ 0)
COMPUTE Y=1
ELSE
COMPUTE Y=2
END IF
* Y is set to 1 for all cases with value 0 for X and
set to 2 for cases with any other value for X.
Exam.
DO IF (X EQ 0)
COMPUTE Y=1
ELSE IF (X LE 9)
COMPUTE Y=9
ELSE
COMPUTE Y=2
END IF
Y
is
捌、個案列印與撰寫 (Listing and Writing Cases)
There are occasions when you want to see the actual contents
of cases. We will introduce PRINT, WRITE, and LIST commands.
The Print Command
It is designed to be simple enough for a quick check on
reading and transforming data and yet flexible enough for
formatting simple reports.
It begins with a slash followed by the list of variables to
be printed.
PRINT / MOHIRED YRHIRED DEPT82 SALARY82 NAME
EXECUTE
If PRINT is not followed by a procedure command that causes
the data to be read, SPSSx does nothing. To execute PRINT command
anyway, use the EXECUTE command document.
Exam.
PRINT /MOHIRED YRHIRED DEPT82 *
SALARY82 (DOLLAR8,1X) NAME *
* tells to print them using their dictionary print formats,
each separate by a blank.
SALARY82 is printed using the $ format, followed by a blank
(1X). DOLLAR8 allows the printing of values up to $999,999.
NAME - dictionary print format of 24 characters.
Exam.
( pp 138 - 139)
** lines
characters.
of output on a PRINT command
cannot
exceed
255
** Lines over 132 characters are continued on the next line
starting in column 2.
PRINT EJECT
It prints the information requested on the command
top of a new page of your output or display file.
Exam.
at
the
DO IF $CASENUM EQ 1
PRINT EJECT /
END IF
EXECUTE
WRITE
It is basically the same as the PRINT except that it is
designed for writing data to be read by other software rather
than by people.
No
blank
variables.
columns
are
inserted
automatically
between
System missing value is represented by blanks.
You can write lines longer than 255 characters.
Exam.
(pp. 143) write out example
LIST
It
displays the values of variables for cases in the active
file.
LIST is a procedure.
Exam.
(EXAM. 144 - 145)
* The CASES subcommand
Exam.
LIST VARIABLES=MOHIRED YRHIRED DEPT82 SALARY79 TO SALARY82 NAME/
CASES FROM 50 TO 100 BY 5
。Every 5 among the list cases is listed.
玖、個案選樣、抽樣 (Selecting and Sampling)
SPSSx allows you to control the number and groups of cases
used in analysis or reporting by selecting, or sampling cases.
Three commands are used:
SELECT IF, SAMPLE, N OF CASES.
SELECT IF
It selects cases based on logical criteria.
Exam.
SELECT IF (SEX EQ 'M')
SELECT IF (VSAT GT MSAT)
SELECT IF (VSAT GT 600 OR MSAT GT 600)
SELECT IF MISSING (X)
-- Selects all cases missing for variable X.
SAMPLE
It selects a random sample of cases.
Exam.
SAMPLE .25
It selects approximately 25 % of cases in the active file.
Exam.
SAMPLE 60 FROM 200
It
cases).
select a random sample of 60 cases from active file (200
N OF CASES
It is to build the first n cases from a file.
SPLIT FILE
It splits the active file into subgroups that are analyzed
separately.
Exam.
SORT CASES BY SEX
SPLIT FILE BY SEX
FREQUENCIES VARIABLES=INCOME
This allows to perform separate income frequencies analyses for
men and women.
拾、統計程序指令 (Statistical Procedures)
A. FREQUENCIES
It produces a table of frequency counts and percentages for
the values of individual variables.
Optionally, you can obtain
bar charts for discrete variables, histograms for continuous
variables, univariate summary statistics, and percentiles.
To
produce only statistics on interval-level data, you can also use
procedure CONDESCRIPTIVE.
FREQUENCIES VARIABLES=INCOME/FORMAT=NOLABELS/
STATISTICS=DEFAULT MEDIAN
The FORMAT subcommand -- It allows you to control the formating of tables and
the order in which values are sorted within the table, suppress tables, produce
an index of the tables, and write the FREQUENCIES display to another file.
The keywords on the FORMAT subcommand are:
NOLABELS - do not print variable or value labels.
DOUBLE - double space frequency tables
NEWPAGE - begin each table on a new page
CONDENSE - condensed format. The format prints frequency counts in 3 columns.
ONEPAGE - It uses the condensed format for tables that would requires more than
one page.
AFREQ - sort categories in ascending order of frequency
DFREQ - sort categories in descending order of frequency
DVALUE - sort categories in descening order of value
LIMIT(n) - do not print tables with more categories than the specified value
若 Categories 超過 n 之值,則不印表
NOTABLE - suppress all frequency tables
WRITE - direct display to another file
Exam.
FILE HANDLE CODEBOOK/FILE='CODEBOOK SPSSX A1'
PROCEDURE OUTPUT OUTFILE=CODEBOOK
FREQUENCIES VARIABLES=ALL/
FORMAT=ONEPAGE WRITE/
。This writes a rrelatively compact codebook to the file CODEBOOK SPSSX A1.
STATISTICS subcommand
Available keywords for the STATISTICS are:
DEFAULT - mean, standard deviation, minimum and maximum
MENA
STDDEV
MINIMUM
MAXIMUM
SEMEAN - standard error of the mean
VARIANCE
SKEWWNESS
SESKEW - standard error of skewness
KURTOSIS
SEKURT - standard error of kurtosis
RANGE
MODE
MEDIAN
SUUM
ALL
NONE - no statistics
Limitations:
。a maximum of 500 variables
。a maximum value range of 32,767 for a variable
範例
SET WIDTH=80
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
FREQUENCIES VARIABLES=SATFIN/STATISTICS=DEFAULT
FINISH
結果
SATFIN
SATISFIED WITH FINANCIAL SITUATION
Value Label
PRETTY SATISFIED
MORE OR LESS
NOT SATISFIED
Value
1
2
3
Frequency
289
440
269
Percent
Valid
Percent
Cum
Percent
28.9
44.0
26.9
29.0
44.1
27.0
29.0
73.0
100.0
NA
9
Total
Mean
Maximum
Valid cases
1.980
3.000
998
Std dev
Missing cases
2
------1000
.748
2
.2
------100.0
Missing
------100.0
Minimum
1.000
B. CONDESCRIPTIVE
It calculates the mean, standard deviation, minimum, and
maximum for numeric variables.
You can request
optional
statistics and Z-score transformations.
CONDESCRIPTIVE ALL
STATISTICS 1,2,5,6,7,8,9,10
OPTIONS 3
SET WIDTH=80
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
FREQUENCIES VARIABLES=SATFIN/STATISTICS=DEFAULT
Number of valid observations (listwise) =
Variable
Mean
Std Dev
Minimum
AGE
45.410
18.087
994.00
Maximum Valid N
18
89
Label
994
The following Z-Score variables have been saved on your active file:
From
To
Weighted
Variable
Z-Score
Label
Valid N
-------- ----------------AGE
ZAGE
ZAGE
Value
-1.51549
-1.46020
-1.40491
Zscore(AGE)
994
Zscore(AGE)
Cum
Freq Pct Pct
4
23
12
0
2
1
0
3
4
Value
-.18856
-.13327
-.07798
Cum
Freq Pct Pct
14
16
19
1
2
2
51
52
54
Value
1.13837
1.19366
1.24894
Cum
Freq Pct Pct
16
15
9
2
2
1
85
86
87
-1.34962
12
1
5
-.02269
14
1
55
1.30423
9
1
88
-1.29433
-1.23904
-1.18375
-1.12847
-1.07318
-1.01789
-.96260
-.90731
-.85202
-.79673
12
20
32
28
21
30
26
22
22
13
1
2
3
3
2
3
3
2
2
1
6
8
12
14
16
20
22
24
27
28
.03259
.08788
.14317
.19846
.25375
.30904
.36433
.41961
.47490
.53019
20
10
8
14
10
22
14
17
14
13
2
1
1
1
1
2
1
2
1
1
57
58
59
61
62
64
65
67
68
70
1.35952
1.41481
1.47010
1.52539
1.58068
1.63596
1.69125
1.74654
1.80183
1.85712
10
7
14
7
7
4
6
6
12
5
1
1
1
1
1
0
1
1
1
1
89
90
91
92
92
93
93
94
95
96
-.74145
37
4
32
.58548
18
2
72
1.91241
9
1
97
-.68616
-.63087
-.57558
-.52029
-.46500
-.40971
-.35443
-.29914
-.24385
13
30
16
19
20
16
23
15
22
Value
Freq
.
Valid cases
1
3
2
2
2
2
2
2
2
33
.64077
36
.69606
38
.75135
39
.80663
41
.86192
43
.91721
45
.97250
47 1.02779
49 1.08308
M I S S I N G
Value
3
10
14
16
18
13
13
16
10
0
1
1
2
2
1
1
2
1
D A T
Freq
6
994
Missing cases
6
72
73
74
76
78
79
80
82
83
A
1.96770
2.02298
2.07827
2.13356
2.18885
2.24414
2.29943
2.41000
7
3
6
3
2
3
4
6
Value
Freq
1
0
1
0
0
0
0
1
97
98
98
98
99
99
99
100
C. CROSSTABS
It produces tables that are the joint distribution of two or
more variables that have a limited number of distinct values.
CROSSTABS can operate in either general or integer mode.
General mode
CROSSTABS TABLES=FEAR BY SEX
or
CROSSTABS FEAR BY SEX
You can use keyword BY to signify a control variable.
Exam.
CROSSTABS TABLES=FEAR BY SEX BY RACE
Integer mode
Exam.
CROSSTABS VARIABLES=FEAR (1,2) MOBILE16 (1,3)/
TABLES=FEAR BY MOBILE16
Options:
1 including missing values
2 suppress variable and value labels
3 print row percentages
4 print column percentages
5 print total percentage
6 suppress value labels
7 report missing values in table
8 print rows ordered on hgighest to lowest values
9 print index of tables
10 write cell count for nonempty cells to a file
11 write cell count for cells to a file
12 suppress tables
13
14
15
16
18
suppress cell counts
print expected frequencies
print residuals
print standardized residuals
print all cell information
Statistics:
1 chi square
2 phi for 2 X 2 table, Cramer's V
3 contingency coefficient
4 lambda
5 uncertainty coefficient
6 Kendall's tau b
7 Keendall's tau c
8 gamma
9 Somer's d
10 eta
11 pearson's r
Limitations
。A maximum of 200 variables per command
。A maximum of 250 nonempty rows or columns
。A maximum of 20 tables lists per command
。A maximum of 10 dimensions per table
SET WIDTH=80
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
CROSSTABS TABLES=CAPPUN BY SEX
STATISTICS 1 2 3 4 5 6 7 8 9
CAPPUN
CAPPUN
DO YOU FAVOR DEATH PENALTY by SEX
SEX
Page 1 of 1
Count I
IMALE
FEMALE
I
Row
FAVOR
OPPOSE
I
1 I
2 I Total
--------+--------+--------+
1 I
312 I
376 I
688
I
I
I 72.7
+--------+--------+
2 I
81 I
177 I
258
I
I
I 27.3
+--------+--------+
Column
393
553
946
Total
41.5
58.5
100.0
Chi-Square
--------------------
Value
-----------
DF
----
Significance
------------
Pearson
Continuity Correction
Likelihood Ratio
Mantel-Haenszel
15.04343
14.47435
15.36517
15.02754
1
1
1
1
.00011
.00014
.00009
.00011
Minimum Expected Frequency -
107.182
Statistic
--------------------
Value
---------
ASE1
--------
T-value
-------
Approximate
Significance
------------
Phi
Cramer's V
Contingency Coefficient
.12610
.12610
.12511
Lambda :
symmetric
with CAPPUN
.00000
.00000
.00000
.00000
.00000
.00000
.01590
.01590
.00789
.00787
.01284
.01386
.00645
.00696
1.98840
1.98840
.00009 *3
.00009 *3
.01196
.00602
1.98840
.00009 *3
.12610
.11071
.28908
.03128
.02767
.07078
4.00062
4.00062
4.00062
.03112
.02846
4.00062
4.00062
.03457
4.00062
dependent
with SEX
dependent
Goodman & Kruskal Tau :
with CAPPUN
dependent
with SEX
dependent
Uncertainty Coefficient :
symmetric
with CAPPUN
dependent
with SEX
dependent
Kendall's Tau-b
Kendall's Tau-c
Gamma
Somers' D :
symmetric
with CAPPUN
dependent
.12546
.11397
with SEX
dependent
.13953
.00011 *1
.00011 *1
.00011 *1
.00011 *2
.00011 *2
D. BREAKDOWN
It calculates means and variances for a criterion or
dependent variable over subgroups of cases defined by independent
or control variables.
Like CROSSTABS,
integer mode.
it
also
operates in
either
general
or
An maximum of six dimensions can be specified on an analysis
list:
one dependent variable and 5 independent variables.
general mode
Exam.
BREAKDOWN TABLES=PCTRAISE BY GRADE81
or
BREAKDOWN PCTRAISE BY GRADE81
Integer mode
Exam.
BREAKDOWN VARIABLES=DEPT8 (1,4) EEO81 (1,9) RAISE81
(LO,HI)/TABLES=RAISE81 BY DEPT81 BY EEO81
Options:
1 including missing values
2 exclude missing values for dependent variables only
3
4
5
6
7
8
suppress variable and value labels
tree format
suppress cell frequencies
suppress cell sum
suppress cell standard deviations
suppress value labels
Statistics:
1 one way analysis of variance
2 test of linearity
Limitations
。A maximum of 200 variables
。A maximum of 250 tables
。a maximum of 6 dimensions per table
SET WIDTH=80
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
BREAKDOWN TABLES=ATTEND BY DEGREE
STATISTICS 1
D E S C R I P
Criterion Variable
Broken Down by
Variable
Value
T I O N
ATTEND
DEGREE
Label
O F
S U B P O P U L A T I O N S
Mean
Std Dev
Cases
For Entire Population
3.8571
2.6829
994
DEGREE
3.7152
2.7179
302
3.8665
4.3462
3.9487
4.1702
2.6484
2.4971
2.7350
2.8309
502
26
117
47
0
DEGREE
1
DEGREE
2
DEGREE
3
DEGREE
4
Total Cases = 1000
Missing Cases = 6 or
HIGH SCHOOL
JUNIOR COLLEGE
BACHELOR
GRADUATE
.6 Pct
A N A L Y S I S
Criterion Variable
ATTEND
Broken Down by
DEGREE
Value Label
0
1
2
3
HIGH SCHOOL
JUNIOR COLLEGE
BACHELOR
4
GRADUATE
Within Groups Total
Source
Between Groups
O F
V A R I A N C E
Mean
Std Dev
Sum of Sq
Cases
3.7152
3.8665
4.3462
3.9487
2.7179
2.6484
2.4971
2.7350
2223.5099
3514.0578
155.8846
867.6923
302
502
26
117
4.1702
2.8309
368.6383
47
----------------------------------------3.8571
2.6850 7129.7829
994
Sum of
Squares
17.9314
D.F.
4.
Mean
Square
4.4828
F
Sig.
.6218
.6470
Within Groups
7129.7829
Eta = .0501
989
7.2091
Eta Squared = .0025
E. T-TEST
T-TEST compares two sample means by calculating Student's t
and tests of significance of the difference between the means.
It tests either independent samples (different groups of cases)
or paired samples (different variables).
The GROUPS Subcommand
Exam.
T-TEST GROUPS = WORLD (2)/VARIABLES=NTCPUR
* It groups together all cases with the value of WORLD
greater than or equal to 2.
The remaining cases go into the
other group.
Exam.
T-TEST GROUPS = WORLD (1,2)/VARIABLES=NTCPUR
*
Cases
with
values other than 1 or 3 for WORLD
used.
Exam.
T-TEST GROUPS = SEX/VARIABLES=GRADE1 TO GRADE5
The Paired Samples
Exam.
T-TEST PAIRS = WCLOTHES MCLOTHES
* It produces a comparison of two variables.
Exam.
are
not
T-TEST PAIRS = TEACHER CONSTRUC MANAGER
It compares TEACHER with CONSTRUCT,
and CONSTRUCT with MANAGER.
TEACHER with
MANAGER,
Options
OPTIONS 1 - including missing values.
OPTIONS 2
- exclude missing values listwise.
If a case is
missing on any variable named, it is excluded from all analyses.
OPTIONS 3 - suppress variable labels.
OPTIONS 4 - print with an 80 character width.
Limitations
* a maximum of 1 each of groups, variables, and pairs
subcommands per T-TEST command.
The PAIRs specification must
appear last.
* a maximum of 1 grouping variable and 50 analysis variables
for independent samples test.
* a maximum of 400 variables for paired samples test.
SET WIDTH=80
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
T-TEST GROUPS=RACLIVE/VARIABLES=CAPPUN TO BUSING
GROUP 1 - RACLIVE
EQ
1:
YES
GROUP 2 - RACLIVE
EQ
2:
NO
Variable
Number
Standard
Standard
of Cases
Mean
Deviation
Error
-----------------------------------------------------------CAPPUN
DO YOU FAVOR DEATH PENALTY
GROUP 1
439
1.2688
.444
.021
GROUP 2
446
1.2511
.434
.021
-----------------------------------------------------------* Pooled Variance Estimate * Separate Variance Estimate
*
*
F
2-tail *
t
Degrees of 2-tail *
t
Degrees of 2-tail
Value Prob. * Value
Freedom
Prob. * Value
Freedom
Prob.
--------------------------------------------------------------------------
1.05
.643
*
.60
883
.549
*
.60
881.73
.550
--------------------------------------------------------------------------
Variable
Number
Standard
Standard
of Cases
Mean
Deviation
Error
-----------------------------------------------------------GRASS
LEGALIZE USE OF MARIJUANA
GROUP 1
444
1.7230
.448
.021
GROUP 2
477
1.8008
.400
.018
-----------------------------------------------------------* Pooled Variance Estimate * Separate Variance Estimate
*
*
F
2-tail *
t
Degrees of 2-tail *
t
Degrees of 2-tail
Value Prob. * Value
Freedom
Prob. * Value
Freedom
Prob.
-------------------------------------------------------------------------1.26
.015 * -2.79
919
.005 * -2.78
888.68
.006
--------------------------------------------------------------------------
- - - - - - - - - - - - - - - - - T - T E S T - - - - - - - - - - - - - - - - GROUP 1 - RACLIVE
EQ
1:
YES
GROUP 2 - RACLIVE
EQ
2:
NO
Variable
Number
Standard
Standard
of Cases
Mean
Deviation
Error
-----------------------------------------------------------BUSING
DO YOU FAVOR BUSING
GROUP 1
441
1.7370
.441
.021
GROUP 2
465
1.8258
.380
.018
-----------------------------------------------------------* Pooled Variance Estimate
*
F
2-tail *
t
Degrees of 2-tail
Value Prob. * Value
Freedom
Prob.
* Separate Variance Estimate
*
*
t
Degrees of 2-tail
* Value
Freedom
Prob.
-------------------------------------------------------------------------1.35
.002 * -3.26
904
.001 * -3.24
869.05
.001
--------------------------------------------------------------------------
F. ANOVA
It performs analysis of variance for factorial designs, with
the default being the full factorial model.
Although you can specify covariates, ANOVA does not permit a
full analysis of covariance.
For multiple dependent variables, repeated measures designs,
factor
by covariate interactions in the analysis of covariance,
or nested or nonfactorial designs, use the MANOVA procedure.
For one way analysis of variance, you might prefer procedure
ONEWAY.
ONEWAY computes contrasts and multiple comparison tests.
Exam.
ANOVA PRESTIGE BY REGION (1,9)
*
PRESTIGE
is
the dependent variable and
REGION
is
the
factor, with minumum and maximum values of 1 and 9.
Exam.
ANOVA RESTIGE BY REGION (1,9) SEX, RACE (1,2)
* It is a three way design.
Specifying Covariates
The covariate list can name up to 10
follows the keyword WITH.
Exam.
Options
variables.
ANOVA PRESTIGE BY REGION (1,9) SEX,
EDUC
-
The order of entry
The
list
RACE (1,2)
WITH
1 including missing values
2 suppress labels
3 delete interaction terms
4 delete three way and higher interactions
5 delete four way and higher interactions
6 delete five way interaction
7 process covariance concurrently with main effects
8 process covariates after man effects
9 regression approach
10 hierarchical approach
11 narrow formatting
Statistics
1 MCA table
2 uunstandardized regression coefficients
3 cell means
Limitations
* maximum of 5 ANOVA analysis lists.
* maximum of 10 independent variables per analysis list.
* maximum 5 dependent variables per analysis list.
* maximum of 10 covariates per analaysis list.
* maximum of 5 interaction levels.
* maximum of 25 value labels per variable displayed in
MCA table.
SET WIDTH=80
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
ANOVA CHLDIDEL BY RELIG (1,4) WITH AGE
STATISTICS 1 2 3
* * *
CHLDIDEL
BY RELIG
TOTAL POPULATION
2.81
(
955)
C E L L
M E A N S
IDEAL NUMBER OF CHILDREN
RELIG
1
2
3
4
* * *
the
2.78
(
621)
3.00
(
243)
* * *
2.64
(
22)
2.51
(
A N A L Y S I S
69)
O F
V A R I A N C E
CHLDIDEL IDEAL NUMBER OF CHILDREN
by
RELIG
with AGE
Sum of
Source of Variation
Squares
DF
Covariates
50.835
1
* * *
Mean
Square
F
Sig
of F
50.835
21.962
.000
AGE
Main Effects
RELIG
Explained
Residual
Total
Covariate
50.835
16.320
16.320
67.156
2198.918
2266.073
1
3
3
4
950
954
21.962 .000
2.350 .071
2.350 .071
7.253 .000
Raw Regression Coefficient
AGE
.013
* * *
M U L T I P L E
C L A S S I F I C A T I O N
CHLDIDEL IDEAL NUMBER OF CHILDREN
by
RELIG
with AGE
Grand Mean =
2.81
Variable + Category
RELIG
1
2
3
4
50.835
5.440
5.440
16.789
2.315
2.375
PROTESTANT
CATHOLIC
JEWISH
NONE
N
621
243
22
69
Unadjusted
Dev'n Eta
-.03
.19
-.18
-.30
Adjusted for
Independents
+ Covariates
Dev'n
Beta
-.05
.21
-.31
-.17
.09
Multiple R Squared
Multiple R
A N A L Y S I S
.08
.030
.172
* * *
G. ONEWAY
It produces a one way analysis of variance for an interval
level variable by one independent variable.
Contract and range
tests are available.
Exam.
ONEWAY WELL BY EDUC6 (1,6)
It specifies a one way analysis of variance of WELL, the
dependent variable, by EDUC6, the independent variable with
minimum and maximum values of 1 and 6.
The CONTRAST Subcommand
It specifies
statistic.
a
priori
contrast to be
tested
by
the
t
Exam.
ONEWAY WELL BY EDUC6 (1,6)/
CONTRAST = -1 -1 -1 -1 2 2/
It contrasts the combination of the first four groups
the combination of the last 2 groups.
Exam.
ONEWAY WELL BY EDUC6 (1,6)/
CONTRAST = -1 0000 1/
It contrasts the first group with the last group.
Exam.
ONEWAY WELL BY EDUC6 (1,6)/
with
CONTRAST = -1
0 0 0 .5 .5/
It contrasts group 1 and the combination of groups 5 and 6.
The RANGES subcommand
It specifies any of seven different tests appropriate for
multiple comparisons between means.
Each RANGE specifies one
test.
Exam.
ONEWAY WELL BY EDUC6 (0,6)/
RANGES = SNK/
RANGES = SCHEFFE (.01)
* produces two different ranges test.
The
follwing
subcommand.
tests
can
be
specified
with
the
RANGE
LSD - least significant difference.
Any alpha
between 0 and 1 can be
specified.
DUNCAN - duncan's multiple range test.
Default is .05.
Only .01, .05 and .10
are used.
SNK - Student'-Newman-Keuls.
Only .05 is available as the alpha value.
TUKEYB - Tukey's alternative procedure.
TUKEY - Honestly significant difference.
LSDMOD - Modified LSD.
SCHEFFE
Only .05 is available as the alpha.
Only .05 is available as the alpha.
Any alpha between 0 and 1 can be specified.
- Scheffe's test.
Any alpha between 0 and 1 can be specified.
Statistics
1 descriptive statistics
2 fixed and random effects measures
3 homogeneity of variance tests
Options
1 include missing values
2 exclude missing values listwise
3 suppress variable labels
10 harmonic mean for 4rrange tests
Limitations
* maximum
variable.
of
100 dependent variables
and
1
independent
*
unlimited number of categories for the independent
variable.
However, contrasts and range tests are not performed
if the actual lnumber of nonempty categories exceeds 50.
*
maximum
subcommands.
of
10
CONTRAST
subcommands
and
10
RANGES
* Any alpha values between 0 and 1 are permitted
LSD, LSDMOD, and SCHEFFE range tests.
* SNK, TUCKEY, and TUKEYB
regardless of what is specified.
use an
alpha
the
of
.05
value
for
* DUNCAN uses an alpha value of .01 if the alpha specified
is less than .05;
.05 is the alpha specified is greater than or
equal to .05 but less than .10; .10 if the alpha specified is
greater than or equal to .10; or .05 if no alpha is specified.
SET WIDTH=80
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
ONEWAY CHLDIDEL BY RELIG (1,4)/
CONTRAST=1 -1 0 0/
CONTRAST=1,1,1,-3/
RANGES=SCHEFFE
STATISTICS 1 2 3
- - - - - - - - - - - - - - - - - O N E W A Y - - - - - - - - - - - - - - - - Variable CHLDIDEL
IDEAL NUMBER OF CHILDREN
By Variable RELIG
ANALYSIS OF VARIANCE
SOURCE
BETWEEN GROUPS
WITHIN GROUPS
TOTAL
GROUP
COUNT
D.F.
SUM OF
SQUARES
3
955
958
16.3377
2252.5006
2268.8384
MEAN
STANDARD
DEVIATION
MEAN
SQUARES
5.4459
2.3586
STANDARD
ERROR
F
RATIO
F
PROB.
2.3089
.0750
95 PCT CONF INT FOR MEAN
Grp 1
2.8910
Grp 2
3.2207
Grp 3
3.1151
Grp 4
2.9037
TOTAL
2.9088
624
2.7772
1.4468
.0579
2.6635
TO
243
3.0000
1.7463
.1120
2.7793
TO
23
2.6522
1.0706
.2232
2.1892
TO
69
2.5072
1.6505
.1987
2.1107
TO
959
2.8113
1.5389
.0497
2.7137
TO
FIXED EFFECTS MODEL
2.7139
TO
2.9086
RANDOM EFFECTS MODEL
.1089
2.4646
RANDOM EFFECTS MODEL - ESTIMATE OF BETWEEN COMPONENT VARIANCE
TO
3.1579
0.0191
GROUP
MINIMUM
MAXIMUM
1.5358
.0496
Grp 1
.0000
8.0000
Grp 2
.0000
8.0000
Grp 3
.0000
6.0000
Grp 4
.0000
8.0000
TOTAL
.0000
8.0000
- - - - - - - - - - - - - - - - - O N E W A Y - - - - - - - - - - - - - - - - Variable CHLDIDEL
IDEAL NUMBER OF CHILDREN
By Variable RELIG
CONTRAST COEFFICIENT MATRIX
Grp 1
Grp 3
CONTRAST
CONTRAST
CONTRAST
CONTRAST
1
2
1
2
Grp 2
1.0 -1.0
1.0
1.0
Grp 4
0.0
0.0
1.0 -3.0
VALUE
-0.2228
0.9077
VALUE
POOLED VARIANCE ESTIMATE
S. ERROR
T VALUE
D.F.
0.1161
-1.918
955.0
0.6509
1.394
955.0
SEPARATE VARIANCE ESTIMATE
S. ERROR
T VALUE
D.F.
T PROB.
0.055
0.163
T PROB.
CONTRAST 1
-0.2228
0.1261
-1.766
378.2
0.078
CONTRAST 2
0.9077
0.6489
1.399
90.0
0.165
Tests for Homogeneity of Variances
Cochrans C = Max. Variance/Sum(Variances) = .3383, P = .000 (Approx.)
Bartlett-Box F =
6.056 , P = .000
Maximum Variance / Minimum Variance
2.661
- - - - - - - - - - - - - - - - - O N E W A Y - - - - - - - - - - - - - - - - Variable CHLDIDEL
IDEAL NUMBER OF CHILDREN
By Variable RELIG
MULTIPLE RANGE TEST
SCHEFFE PROCEDURE
RANGES FOR THE 0.050 LEVEL 3.96
3.96
3.96
THE RANGES ABOVE ARE TABLE RANGES.
THE VALUE ACTUALLY COMPARED WITH MEAN(J)-MEAN(I) IS..
1.0860 * RANGE * DSQRT(1/N(I) + 1/N(J))
NO TWO GROUPS ARE SIGNIFICANTLY DIFFERENT AT THE 0.050 LEVEL
H. MANOVA: General Linear Models
It is a generalized multivariate analysis of
covariance program.
variance
and
This procedure performs univariate and multivariate linear
estimation and tests of hypotheses for any crossed and/or nested
design with or without covariates.
You have complete control of the model specification.
With MANOVA you can perform analysis of variance and
analysis of covariance, and you can analyze designs such as
randomized
designs.
block,
split
plot,
nested,
and repeated
measures
Syntax - To run MANOVA, you must indicate which variables are dependent
variables, which are factors (if any), and which (if any) are covariates.
You also need to specify the design to be used.
Exam.
MANOVA BALOMEAN BALCMEAN SSTMEAN PP BY SEX (1,2)
/DISCRIM=RAW STAN CORR ESTIM
/PRINT=SIGNIF(DIMENR) PARAMETERS(ESTIM)
/DESIGN
。The MANOVA begins by specifying BALOMENA, BALCMEAN, SSTMEAN and PP as
the dependent variables and sex as a factor. The DISCRIM reqquests a
canonical analysis of the dependent and independent variables. The
PRINT requests parameters estimates and a dimension reduction analysis
Specifying Factors and the Structure of Data
Dependent variable list -- The first varibles specified are the dependent
variables in the analysis. By default, MANOVA treats a list of dependent
variables as jointly dependnet and therefore uses a multivariate design.
The factor list
--
If factors are to be used in the analysis, they are
specified following the dependent variable list and the keyword BY.
Each
factor is followed by two integer values enclosed in parentheses and separated
by a comma, specifying the lowest and highest values for the factor.
Exam.
MANOVA BALOMEAN BY SEX (1,2) FIELD (1,3)
The covariate list -- The covariate list specifies any covariates to be used
in the analysis. It follows the factor list and is separated from it by the
keyword WITH.
Exam.
MANOVA BALOMEAN BY SEX (1,2) FIELD (1,3) WITH IQ
Specifying the model -- You use ANALYSIS to specify a model. When ANALYSIS
is specified, it completely overrides the dependent variable list and covariate
list in the MANOVA specification.
Only variables in the original MANOVA variable list can be specified on the
ANALYSIS subcommand.
Exam.
MANOVA BALOMEAN PP SSTMEAN BY SEX (1,2) FIELD (1,3) WITH EQ
/ANALYSIS=BALOMEAN PP WITH SSTMEAN
/DESIGN
。 This command changes SSTMEAN from a dependent variable to a covariate.
Specifying nested design -- the WITHIN
nested in the term to its right.
Exam.
indicates that the term to its left is
/DESIGN=TREATMENT WITHIN TESTCAT
。It indicates that TREATMENT is nested within TESTCAT
Specifying within subjects factors -- The WSFACTORS is used for repeated
measures analysis. It provides the names and number of levels for within
subjects factors when you use the multivariate data setup.
Exam.
MANOVA DRUG1 TO DRUG4
/WSFACTORS=TRIAL(4)
WSFACTORS must be the first subcommand after the MANOVA specification, and it
can be specified only once per MANOVA command. Presence of a WSFACTORS invokes
special repeated measures processing.
Specifying within subjects model -- WSDESIGN specifies a within subjects model
and a within subjects transformation matrix based on the ordering of the
continuous variables and the levels of the within subjects factors.
Specifying doubly multivariate designs -- Doubly multivariate repeated
measures designs are the ones of which subjects are measured on two or more
responses on two or more occasions.
When the data are entered using the
multivariate setup, you can use the MEASURE subcommand to name the multivariate
pooled results.
Exam.
MANOVA TEMP1 TO TEMP6, WEIGHT1 TO WEIGHT6 BY GROUP(1,4)
/WSFACTOR=AMPM(2) DAYS(3)
/MEASURE=TEMP WEIGHT
/WSDESIGN=AMPM DAYS AMPM BY DAYS
Specifying canonical analyses -- The DISCRIM requests a canonical analysis of
dependent and independent variables in multivariate analyses. If the
independent variables are continuous, MANOVA produces a canonical correlation
analysis; if they are categorical, MANOVA produces a canonical discriminant
analysis.
Available options are:
RAW -- Raw discriminant function coefficients
STAN -- standardized discriminant function coefficients
ESTIM -- effect estimates in discriminant function space
COR -- correlations between the dependent and canonical variables defined by
the discriminant functions
ROTATE(rottyp) -- Rotation of the matrix of correlations between dependent and
anonical variates. For rottype, specify VARIMAX, EQUAMAX, or QUARTIMAX.
ALPHA(alpha) -- the significant level for the canonical variate. The default
is 0.15.
Specifying printed output -- PRINT and NOPRINT control the output produced by
MANOVA. PRINT requessts specified output, while NOPRINT suppresses it.
Exam.
MANOVA SALES BY TVAD RADIOAD MAGAD NEWSPAD(2,5)
/PRINT=CELLINFO(MEANS)
。 This requests the display of cell means of SALES for all combinations of
values of TVAD RADIOAD MAGAD and NEWSPAD.
Available specifications for PRINT include:
CELLINFO
HOMOGENEITY
DESIGN
ERROR
SIGNIF
PARAMETERS
TRANSFORM
The options for CELLINFO
are:
MEANS
SSCP
COV
COR
The options for HOMOGENEITY are:
BARTLETT
COCHRAN
BOXM
The options for DESIGN are:
ONEWAY
OVERALL
DECOMP
BIAS
SOLUTION
The options for ERROR are:
SSCP
COV
COR
STDDEV
The options for SIGNIF are:
MULTIV
EIGEN
DIMENR
UNIV
HYPOTH
STEPDOWN
AVERF
BRIEF
AVONLY
SIGNLEDF
The options for PARAMETERS are:
ESTIM
ORTHO
COR
NEGSUM
SET WIDTH=80
UNNUMBERED
TITLE 'EXAMPLE ON REPEATED MEASURE'
DATA LIST RECORDS=1
/1 EXPERM 1-2 CONTROL 3-4 PAIR 5-6
BEGIN DATA
080601
090802
050303
040204
020105
100706
030107
120708
060609
110910
END DATA
MANOVA EXPERM CONTROL
/WSFACTOR=ATTI(2)
/WSDESIGN=ATTI
/ANALYSIS(REPEATED)
/DESIGN
Note: there are 2 levels for the ATTI effect.
to the univariate tests of significance.
* * * * * * A N A L Y S I S
10
0
0
1
1
O F
Average tests are identical
V A R I A N C E * * * * * *
cases accepted.
cases rejected because of out-of-range factor values.
cases rejected because of missing data.
non-empty cell.
design will be processed.
* * * * * * A N A L Y S I S
O F
V A R I A N C E -- DESIGN
1 * * * * * *
Tests of Between-Subjects Effects.
Tests of Significance for T1 using UNIQUE sums of squares
Source of Variation
SS
DF
MS
F
WITHIN CELLS
CONSTANT
182.00
720.00
* * * * * * A N A L Y S I S
O F
9
1
20.22
720.00
35.60
V A R I A N C E -- DESIGN
Sig of F
.000
1 * * * * * *
Tests involving 'ATTI' Within-Subject Effect.
Tests of Significance for T2 using UNIQUE sums of squares
Source of Variation
SS
DF
MS
F
WITHIN CELLS
8.00
9
.89
Sig of F
ATTI
20.00
1
20.00
22.50
.001
J. PEARSON CORR
It
produces pearson
significance levels.
product
Univariate
statistics,
deviations are also available.
moment
covariances
correlations
and
cross
with
product
Exam.
PEARSON CORR FOOD RENT PUBTRANS TEACHER COOK ENGINEER
It produces a square correlation coefficient matrix.
Exam.
PEARSON CORR
ENGINEER
FOOD
RENT
WITH
COOK
TEACHER
MANAGER
It produces the eight correlations.
Exam.
PEARSON CORR FOOD RENT/COOK TEACHER
/ (Slash) is used to separate the specifications for each of
the requested matrices.
Statistics
STATISTICS 1 - mean, standard deviation,
nonmissing cases for each variable.
and
number
STATISTICS 2 - cross product deviations and covariance
eacdh pair of variables.
Options
of
for
OPTION 1 - include missing values
OPTION 2 - exclude missing values listwise.
OPTION 3 - two tailed test of significance.
OPTION 4 - write matrix materials to a file.
OPTION 5 - suppress printing of n and significance level.
OPTION 6 - print only the nonredundant coefficients in
serial string format.
Limitations
。 maximum of 40 variables lists.
。 maximum of 500 variables total per PEARSON CORR command.
。 maximum of 250 individual elements.
Each
unique
occurrence of a variable name, keyword, or special delimiter
counts as 1 toward this total.
SET WIDTH=80
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
PEARSON CORR HAPPY SATFAM SATFRND SATJOB INCOME DEGREE
STATISTICS 1 2
VARIABLE
CASES
MEAN
STD DEV
994
990
989
982
954
998
1.7938
2.1596
2.3256
1.3666
8.9151
1.0982
.6353
1.3695
1.2449
.9621
3.2107
1.1018
HAPPY
SATFAM
SATFRND
SATJOB
INCOME
DEGREE
VARIABLES
CASES
CROSS-PROD DEV
VARIANCE-COVAR
HAPPY
HAPPY
HAPPY
HAPPY
HAPPY
SATFAM
SATFAM
SATFRND
SATJOB
INCOME
DEGREE
SATFRND
988
987
976
948
992
986
306.8300
258.4326
39.7275
-358.6203
-56.4637
751.2353
.3109
.2621
.0407
-.3787
-.0570
.7627
SATFAM
SATFAM
SATFAM
SATFRND
SATFRND
SATFRND
SATJOB
SATJOB
SATJOB
INCOME
DEGREE
SATJOB
INCOME
DEGREE
INCOME
DEGREE
972
944
988
971
946
987
937
981
53.6481
-994.7712
-35.2540
112.6334
-481.7040
-66.7072
387.6147
70.7706
.0553
-1.0549
-.0357
.1161
-.5097
-.0677
.4141
.0722
INCOME
DEGREE
952
- - - - P E A R S O N
HAPPY
SATFAM
1.0000
( 994)
P= .
.3582
( 988)
P= .000
.3582
1.0000
(
988)
.9830
C O R R E L A T I O N
HAPPY
SATFAM
934.8036
(
990)
SATFRND
C O E F F I C I E N T S
SATJOB
INCOME
DEGREE
.3316
( 987)
P= .000
.0665
( 976)
P= .019
-.1855
( 948)
P= .000
-.0814
( 992)
P= .005
.4484
.0420
-.2397
-.0236
- - -
(
986)
(
972)
(
944)
(
988)
P= .000
P= .
P= .000
P= .095
P= .000
P= .229
SATFRND
.3316
( 987)
P= .000
.4484
( 986)
P= .000
1.0000
( 989)
P= .
.0972
( 971)
P= .001
-.1294
( 946)
P= .000
-.0493
( 987)
P= .061
SATJOB
.0665
( 976)
P= .019
.0420
( 972)
P= .095
.0972
( 971)
P= .001
1.0000
( 982)
P= .
.1358
( 937)
P= .000
.0683
( 981)
P= .016
INCOME
-.1855
( 948)
P= .000
-.2397
( 944)
P= .000
-.1294
( 946)
P= .000
.1358
( 937)
P= .000
1.0000
( 954)
P= .
.2770
( 952)
P= .000
DEGREE
-.0814
( 992)
P= .005
-.0236
( 988)
P= .229
-.0493
( 987)
P= .061
.0683
( 981)
P= .016
.2770
( 952)
P= .000
1.0000
( 998)
P= .
(COEFFICIENT / (CASES) / 1-TAILED SIG)
" . " IS PRINTED IF A COEFFICIENT CANNOT BE COMPUTED
K. PARTIAL CORR
It produces partial correlation coefficients that describe
the relationship between two variables while adjusting for the
effects of one or more additional variables.
You must supply a set of variables to be correlated, one or
more control variables following the keyword by, and a list of
order values in parentheses which define the level of control.
Exam.
PARTIAL CORR PUBTRANS MECHANIC BUSDRVER BY NETPURSE (1)
*
It produces a square matrix containing three unique first
order partial correlations: PUBTRANS correlated with MECHANIC,
controlling for NETPURSE; PUBTRANS with BUSDRVER, controlling for
NETPURSE; and MECHANIC with BUSDRVER, controlling for NETPURSE.
* (1) indicates a first order partial correlation.
Exam.
PARTIAL CORR
RENT WITH YRS OCCUP BY NETSALRY (1)
* It produces two first order partials: RENT with YRS
controlling for NETSALRY and RENT with YRS controlling for
NETSALRY.
Exam.
PARTIAL CORR RENT WITH YRS BY NETSALRY, NETPRICE (2)
* It produces one second order partial of RENT
controlling simultaneously for NETSALRY, NETPRICE.
with
YRS,
Exam.
PARTIAL CORR RENT BY NETSALRY NETPURSE NETPRICE (1,3)
*
It
produce
correlations.
first
order
and
third
order
partial
Exam.
PARTIAL CORR V1 WITH V2 BY D (1)/ V1 WITH V3 BY D(1)
* / (Slash) is
correlation analysis.
used
to separate
each
set
of
partial
* You can specify up to 25 partial correlation analyses
each PARTIAL CORR command.
on
Optional Statistics
STATISTICS 1 - zero order correlations
freedom and significance level.
STATISTICS 2 - mean,
nonmissing cases.
Options
with
standard deviation,
and
degrees
of
number
of
OPTIONS 1 - including missing values.
OPTIONS 2 - exclude
analysis basis.
missing
values
on
an
analysis
by
freedom
and
OPTIONS 3 - two tailed test of significance.
OPTIONS 5 - write matrix materials to a file.
OPTIONS
7 - suppress
significance level.
printing of degrees of
OPTIONS 8 - print only the
serial string format.
nonredundant
coefficients
in
Limitations:
* a maximum of 25 requests on a single partial corr command.
* a maximum of 400 variables total can be named per partial
corr command.
* a maximum of 100 control variables.
SET WIDTH=80
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
PARTIAL CORR HAPPY WITH SATFAM SATFRND SATJOB
- - - - P A R T I A L
CONTROLLING FOR..
HAPPY
C O R R E L A T I O N
BY DEGREE INCOME (1,2)
C O E F F I C I E N T S
- - -
DEGREE
SATFAM
SATFRND
SATJOB
.3749
( 920)
P= .000
.3271
( 920)
P= .000
.0835
( 920)
P= .006
(COEFFICIENT / (D.F.) / SIGNIFICANCE)
" . " IS PRINTED IF A COEFFICIENT CANNOT BE COMPUTED.
- - - - P A R T I A L
CONTROLLING FOR..
HAPPY
C O R R E L A T I O N
INCOME
SATFAM
SATFRND
SATJOB
.3483
.3148
.1043
C O E F F I C I E N T S
- - -
(
920)
(
P= .000
920)
P= .000
(
920)
P= .001
(COEFFICIENT / (D.F.) / SIGNIFICANCE)
" . " IS PRINTED IF A COEFFICIENT CANNOT BE COMPUTED.
- - - - P A R T I A L
CONTROLLING FOR..
SATFAM
C O R R E L A T I O N
DEGREE
SATFRND
INCOME
SATJOB
C O E F F I C I E N T S
- - -
HAPPY
.3496
( 919)
P= .000
.3147
( 919)
P= .000
.1053
( 919)
P= .001
(COEFFICIENT / (D.F.) / SIGNIFICANCE)
" . " IS PRINTED IF A COEFFICIENT CANNOT BE COMPUTED.
L. REGRESSION
It calculates a multiple regression equation and associated
statistics and plots.
Several methods for variable selection as well as statistics
for analysis of residuals and influential observations are
available.
Several
types of plots,
including partial residual
plots,
can be displayed.
Minimum
requirement:
You must specify three
things:
the
variables to be used, the dependent variable or variables in the
analysis, and one or more variable selection methods.
Six variable selection methods are available.
VARIABLES Subommand
Three ways to indicate the variables to be analyzed.
Exam.
REGRESSION VARIABLES=SAVINGS POP15 POP75 INCOME GROWTH/
Exam.
REGRESSION VARIABLES=(COLLECT)/
DEPENDENT = SAVINGS/
ENTER POP15 POP75 INCOME GROWTH/
* The keyword COLLECT in parentheses indicates that the
program should assemble the list of variables from the DEPENDENT
subcommands and from each of the regression method subcommands.
Exam.
REGRESSION VARS = IQ TO ACHIEVE/
DEP=ACHIEVE/STEP/
VARS= (COLLECT)/
DEPT=ATHLETIC/
BACKWARDS=AGE HEIGHT WEIGHT MUSCLES COACH
EQUIPMENT/
SELECT VITAMINC GT 250/
VARS=(PREVIOUS)/
DEP=ATHLETIC/
BACKWARD
*
The first set of subcommands specifies a stepwise
regression with variable ACHIEVE as the dependent variable.
* In the second analysis, the COLLECT keyword causes SPSSx
to use the variables mentioned on the DEPENDENT and BACKWARD
method subcommands as variables for the analysis.
* The third analysis uses the same variables as the
but a different set of cases.
second
- The SELECT subcommand selects cases with values greater
than 250 for variable VITAMINC for calculating
regression
statistics.
- The
keyword (PREVIOUS) on the VARIABLES
subcommand
indicates that the variables used in the second analysis will
also be used in this analysis.
The DEPENDENT Subcommand
The dependent variable or variables must be named in the
VARIABLES subcommand unless you specify the (COLLECT) keyword.
None of the variables named on the DEPENDENT subcommand is
treated as an independent variable in any model associated with
that DEPENDENT subcommand.
Each DEPENDENT subcommand initiates a new regression model.
There
are two ways to specify multiple dependent variables.
Exam.
REGRESSION VARIABLES=IQ TO ACHIEVE/
DEPENDENT=ACHIEVE IQREPORT/STEPWISE.
*
ACHIEVE
is
first used as the
dependent
variable
then
IQREPORT as the dependent variable in a new regression model.
* IQREPORT is not used as an independent variable when
ACHIEVE is the dependent variable, and ACHIEVE is not used as an
independent variable when IQREPORT is the dependent variable.
Exam.
REGRESSION VARIABLES=IQ TO ACHIEVE/
DEPENDENT=ACHIEVE/STEOWUSE/
DEPENDENT=IQREPORT/ENTER ACHIEVE,SES,IQ/
* Note that IQREPORT is an independent variable in the first
model, and ACHIEVE is an independent variable in the second
model.
The METHOD Subcommands
Six equation building methods are available.
FORWARD - Variables are entered into the equation one at at time. At each
step, the independent variables not yet in the equation are examined for entry.
The variable with the smallest probability-of-F is entered.
BACKWARD - The independent variables already in the equation are examined for
removal. Variables are removed from the equation one at a time.
with the largest probability-of-F value is removed.
The variable
STEPWISE - The variable with the largest probability-of-F is examined for
removal. If the probability-of-F is larger than the removal criterion POUT,
the variable is removed. The equation is recomputed without the removed
variable, and the rest of the variables are examined for removal. Once no more
independent variables need to be removed, all independent variables not in the
equation are examined for entry. The variable with the smallest probability of
F is entered if this value is smaller than the entry criterion PIN and the
variable passes the tolerance tests. Once a variable has been entered, all
variables in the equation are again examined for removal. This process
continues untiil no variables in the equation need to be removed and no
variables not in the equation are eligible for entry.
ENTER - It enters all variables that satisfy the tolerance criterion.
Variables are entered one at a time in order of decreasing tolerance but
are treated as a single block for statistics computed for changes in the
equation.
REMOVE - It removes all named variables from the equation as a single
block.
TEST - It offers an easy way to test a variety of models using R-square change
and its test of significance as the criterion for the best model.
Exam.
REGRESSION VARIABLES=IQ TO ACHIEVE/
DEPENDENT=ACHIEVE/STEPWISE/ENTER
* You can specify multiple method subcommands
same equation.
The MISSING Subcommand
within
the
Use the MISSING subcommand and one of the following keywords
to specify alternative missing value treatments.
LISTWISE - delete cases with
missing values listwise.
PAIRWISE - delete cases with missing values pairwise
MEANS - replace missing values with the varible mean
INCLUDE - include cases with missing values
Exam.
REGRESSION VARS=FAEDUC TO RINCOME/
DEP=RINCOME/STEP/
MISSING = MEANS/
VARS=(PREVIOUS)/
DEP=RINCOME/STEP
The
(the
first
model uses listwise deletion of
missing
values
default).
The second model uses the same variables,
substitution to replace missing values.
but
uses
mean
The DESCRIPTIVES Subcommand
This subcommand precedes the VARIABLES subcommand and it
remains in effect until overridden by a new list of descriptive
staistics or by specifying DESCRIPTIVES = NONE.
Descriptive
variable list.
statistics
are
displayed only once
for
each
Keyword specifications for the DESCRIPTIVES subcommand to
display statistics for all variables on the VARIABLES subcommand.
NONE - turn off all descriptive statistics.
DEFAULTS - mean, standard deviation, correlation matrix.
MEAN - variable means.
STDDEV - variable standard deviation.
VARIANCE - variable variances.
CORR - correlation matrix.
SIG - one
coefficients.
tailed significance levels
of
the
correlation
COV - covariance matrix
XPROD - cross product deviations from the mean.
N - numbers
coefficients.
of
cases
used
to
compute
correlation
Exam.
REGRESSION DESCRIPTIVES=DEFAULTS VARIANCE SIG COV XPROD/
VARS=SAVINGS TO GROWTH/
DEP=SAVINGS/ENTER
The SELECT Subcommand
It is to select a subset of your cases for
regression equation.
computing
the
The general form is:
SELECT = variable name relation value/
The relation can be EQ, NE, LT, LE, GT, or GE.
A
SELECT subcommand must
subcommand to which it applies.
appear
Exam.
REGRESSION SELECT SEX EQ 'BOYS'/
VARS = IQ TO ACHIEVE/
DEP=ACHIEVE/STEP/
SELECT SEX EQ 'GIRLS'/
VARS = IQ ATO ACHIEVE/
before
the
VARIABLES
DEP = ACHIEVE/STEP/
SELECT (ALL)/
VARS = IQ TO ACHIEVE/
DEP = ACHIEVE/STEP/
It produces 3 analyses - one using only boys' data,
using only girls' data, and one using the combined data.
All three VARIABLES subcommands are necessary.
The CRITERIA Subcommand
one
All variables are tested for tolerance prior to entry
an equation.
into
The tolerance of a variable is the proportion of its
variance not accounted for by other independent variables in the
equation.
The minimum tolerance of a variable is the
smallest
tolerance any variable already in the analysis would have.
A variable must pass both tolerance and minimum
tests in order to enter a regression equation.
tolerance
The CRITERIA must appear before the DEPENDENT subcommand and
after the VARIABLES subcommand.
The CRITERIA remain in effect for all subsequent
analyses until modified.
regression
Exam.
REGRESSION
VARS=SALARY TO VERBAL/
CRITERIA=PIN (.1) POUT (.15) TOL (.0001)/
DEP=VERBAL/FORWARD/
CRITERIA=DEFAULTS/
DEP=VERBAL/STEPWISE
for
* The first CRITERIA subcommand relaxes the default criteria
entry and removal, while the second CRITERIA subcommand
reestablishes the defaults.
Exam.
CRITERIA = PIN (.03) FIN (2.0)/
*
enter
SPSSx first sets the criterion to a probability of
of 0.03.
F
to
* This criterion is replaced by the FIN specification which
sets the criterion to an F value of 2.0.
The Criteria keywords are:
DEFAULTS PIN(values)
POUT(value)
FIN(value)
FOUT(value)
PIN(0.05),POUT(0.1), and TOLERANCE(0.01).
- probability of F-to-enter. The default is 0.05
- probability of F to remove. Default is 0.10
- F to enter. Default is 3.84
- F to remove. Default is 2.71
TOLERANCE(value)
- tolerance.
Default is 0.01
The STATISTICS Subcommand
It is used to
regression equation.
display a number
of
statistics
for
the
There are three types of STATISTICS keywords: (1) controls
for the volume of output; (2) summary statistics for the
equation; and (3) statistics for the independent variables.
The keywords are:
DEFAULTS - R, ANOVA, COEFF, and OUTS.
ALL - print all summary statistics except LABEL, F, LINE, and END.
R - Multiple R.
ANOVA - analysis of variance table.
CHA - change in R-square
BCOV - variance covariance matrix for unstandardized regression coefficients.
COEFF - regression coefficients
OUTS - coefficients and statistics for variables not yet in the equation
LABEL - variable labels.
F - F value for B and its significance level.
Analysis of Residuals
The
following
subcommands are used for
residuals: RESIDUALS, CASEWISE, SCATTERPLOT.
The following temporary variables are
analysis of residuals.
PRED - unstandardized predicted values.
RESID - unstandardized residuals.
DRESID - deleted residuals.
ADJPRED - adjusted predicted values.
analysis
available
for
of
the
ZPRED - standardized predicted values.
ZRESID - standardized residuals.
SRESID - studentized residuals.
SDRESID - studentized deleted residuals.
SEPRED - standard errors of the predicted values.
MAHAL - Mahalanobis' distances.
COOK - Cook's distances.
LEVER - Leverage values.
The RESIDUALS Subcommand
Several measures and plots based on the residuals and
predicted values for the regression equation can be displayed.
Exam.
RESID = DEFAULT SIZE(SMALL) ID(COUNTRY)/
It requests residual statistics and plots.
Default implies
a normal probability plot of standardized residuals, a histogram
of standardized residuals, a table showing the 10 worst outliers
based on the values of the standardized residuals, the Durbin
Watson statistic, and large plot sizes.
SIZE
(SMALL) overrides the large plot
ID(COUNTRY) names
cases on outlier plots.
sizes.
COUNTRY as a variable
to
identify
the
The CASEWISE Subcommand
It displays a casewise plot of any of the temporary
residuals variables accompanied by a listing of the values of
the dependent variable and the values of as many of the other
temporary
width.
variables
as can be displayed in the
available
page
Exam.
CASEWISE = DEFAULT ALL SRE MAH COOK SRD/
It
displays
the
dependent variable SAVINGS
and
the
six
temporary variables PRED, RESID, SRESID, SDRESID, MAHAL, and COOK
D for all cases and plots the standardized
casewise plot.
residuals
in
the
The CASEWISE subcommand has the following DEFAULT specifications:
DEFAULTS - OUTLIERS(3),PLOT(ZRESID),DEPENDENT,PRED,and RESID.
The SCATTERPLOT Subcommand
It displays a series of scatterplots of the temporary
variables and the variables in the regression equation.
Exam.
SCATTERPLOT (*RES, *PRE) (*RES, SAVINGS)/
* It specifies two scatterplots - the plot of the residuals
against the predicted values and the plot of the residuals
against the values of the dependent variable.
* The first variable named in each set of
plotted along the vertical axis.
parentheses
is
* The second variable is plotted along the horizontal axis.
* plotting symbols are used to represent
occurring at the same print position.
*
Note:
distinguish the
variable name.
You
must
precede
temporary
the
variable
multiple
keyword
keyword
with
from
a
an
points
*
to
standard
SET WIDTH=80
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
REGRESSION VARS=INCOME,AGE,MARITAL,DEGREE,SEX,CHILDS,SATFAM/
STATISTICS=ALL/DEP=SATFAM/STEP
* * * *
Equation Number 1
M U L T I P L E
R E G R E S S I O N
* * * *
Dependent Variable..
SATFAM
SATISFIED WITH FAMILY LIFE
Beginning Block Number
1.
Method:
Variable(s) Entered on Step Number
1..
MARITAL
Stepwise
Multiple R
R Square
Adjusted R Square
Standard Error
.33971
.11541
.11444
1.27096
Analysis of Variance
DF
Regression
1
Residual
918
F =
119.76377
R Square Change
.11541
F Change
119.76377
Signif F Change
.0000
Sum of Squares
193.45983
1482.88691
Signif F =
.0000
Mean Square
193.45983
1.61535
---------------------- Variables in the Equation ----------------------Variable
B
SE B
95% Confdnce Intrvl B
Beta
MARITAL
.307430
.028092
.252298
.362562
.339714
(Constant)
1.530539
.069869
1.393418
1.667660
-------------------------- Variables in the Equation --------------------------Variable
SE Beta
Correl Part Cor Partial Tolerance
VIF
T
MARITAL
10.944
.031042
.339714
.339714
.339714
1.000000
1.000
(Constant)
21.906
* * * *
Equation Number 1
------ in ------Variable
Sig T
MARITAL
(Constant)
M U L T I P L E
R E G R E S S I O N
* * * *
Dependent Variable..
SATFAM
SATISFIED WITH FAMILY LIFE
.0000
.0000
------------------------ Variables not in the Equation -----------------------Variable
Beta In Partial Tolerance
VIF Min Toler
T Sig T
INCOME
AGE
DEGREE
SEX
CHILDS
-.163702
.159747
-.059652
-.055525
-.008806
-.168957
.164576
-.063285
-.058987
-.008681
.942300
.938891
.995595
.998318
.859752
1.000
1.000
1.000
1.000
1.000
.942300
.938891
.995595
.998318
.859752
Variable(s) Entered on Step Number
2..
INCOME
TOTAL FAMILY INCOME
Multiple R
R Square
Adjusted R Square
.37504
.14066
.13878
R Square Change
F Change
.02525
26.94641
-5.191 .0000
5.053 .0000
-1.920 .0551
-1.789 .0739
-.263 .7927
Standard Error
1.25337
Analysis of Variance
DF
Regression
2
Residual
917
F =
Signif F Change
Sum of Squares
235.79113
1440.55561
75.04759
Signif F =
.0000
Mean Square
117.89556
1.57094
.0000
---------------------- Variables in the Equation ----------------------Variable
MARITAL
B
SE B
.271844
.028539
95% Confdnce Intrvl B
.215835
.327853
Beta
.300391
INCOME
-.069201
.013331
(Constant)
2.219584
.149556
-------------------------- Variables in
Variable
SE Beta
Correl Part Cor
MARITAL
9.525
INCOME
(Constant)
14.841
.031536
.339714
-.095364
-.043038
-.163702
1.926072
2.513095
the Equation --------------------------Partial Tolerance
VIF
T
.291596
.300062
.031536 -.235859 -.158909 -.168957
.942300
.942300
1.061
1.061
-5.191
------ in ------Variable
Sig T
MARITAL
INCOME
(Constant)
.0000
.0000
.0000
Variable(s) Entered on Step Number
3..
AGE
Multiple R
R Square
Adjusted R Square
Standard Error
.39196
.15363
.15086
1.24455
Analysis of Variance
DF
Regression
3
Residual
916
F =
55.42373
R Square Change
F Change
Signif F Change
Sum of Squares
257.54003
1418.80671
Signif F =
.01297
14.04138
.0002
Mean Square
85.84668
1.54892
.0000
* * * *
M U L T I P L E
R E G R E S S I O N
* * * *
Equation Number 1
Dependent Variable..
SATFAM
SATISFIED WITH FAMILY LIFE
---------------------- Variables in the Equation ----------------------Variable
B
SE B
95% Confdnce Intrvl B
Beta
MARITAL
.306960
.029847
INCOME
-.054308
.013821
AGE
.009376
.002502
(Constant)
1.597968
.222649
-------------------------- Variables in
Variable
SE Beta
Correl Part Cor
MARITAL
10.284
INCOME
.032982
AGE
3.747
(Constant)
.032754
.339714
.312613
.248383
.365537
.339195
-.081433
-.027184
-.128472
.004466
.014287
.122736
1.161007
2.034928
the Equation --------------------------Partial Tolerance
VIF
T
.321736
.032695 -.235859 -.119443 -.128751
7.177
------ in ------Variable
Sig T
.066007
.113903
.122872
.849410
.864378
.861252
1.177
1.157
1.161
-3.929
MARITAL
.0000
INCOME
.0001
AGE
.0002
(Constant) .0000
------------------------ Variables not in the Equation -----------------------Variable
Beta In Partial Tolerance
VIF Min Toler
T Sig T
DEGREE
SEX
CHILDS
.005261 .005379
-.071318 -.076702
-.055036 -.053923
.884787
.978994
.812479
.861
.861
.861
.808623
.843368
.762361
.163 .8708
-2.327 .0202
-1.633 .1027
Variable(s) Entered on Step Number
4..
SEX
Multiple R
R Square
Adjusted R Square
Standard Error
.39826
.15861
.15493
1.24157
Analysis of Variance
DF
Regression
4
Residual
915
F =
43.12190
Equation Number 1
R Square Change
F Change
Signif F Change
Sum of Squares
265.88718
1410.45956
Signif F =
.00498
5.41500
.0202
Mean Square
66.47179
1.54149
.0000
Dependent Variable..
SATFAM
SATISFIED WITH FAMILY LIFE
---------------------- Variables in the Equation ----------------------Variable
B
SE B
95% Confdnce Intrvl B
Beta
MARITAL
INCOME
AGE
SEX
(Constant)
.301095
-.058794
.009065
-.195293
1.972884
.029882
.013922
.002500
.083924
.274395
.242449
-.086116
.004159
-.359999
1.434368
.359740
-.031471
.013971
-.030587
2.511401
.332714
-.139082
.118664
-.071318
-------------------------- Variables in the Equation --------------------------Variable
SE Beta
MARITAL
10.076
INCOME
AGE
3.626
SEX
(Constant)
7.190
.033020
.305548
Tolerance
VIF
T
.843368
1.186
.032934 -.235859 -.128062 -.138271
.032722 .066007 .109967 .119033
.847809
.858789
1.180
1.164
-4.223
.030648 -.069366 -.070565 -.076702
.978994
1.021
-2.327
.0000
.339714
Partial
.316033
------ in ------Variable
Sig T
MARITAL
Correl Part Cor
INCOME
.0000
AGE
.0003
SEX
.0202
(Constant) .0000
------------------------ Variables not in the Equation -----------------------Variable
Beta In Partial Tolerance
VIF Min Toler
T Sig T
DEGREE
CHILDS
-.002913 -.002970
-.049709 -.048723
End Block Number
1
PIN =
.874370
.808350
.979
.979
.799249
.759847
-.090
-1.475
.050 Limits reached.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Summary table
------------Step
1
2
3
MultR
.3397
.3750
.3920
Rsq
.1154
.1407
.1536
4
.3983
.1586
F(Eqn) SigF
Variable
119.764 .000 In: MARITAL
75.048 .000 In: INCOME
55.424 .000 In: AGE
43.122
.000
In:
SEX
BetaIn
.3397
-.1637
.1227
-.0713
.9285
.1406
M.
區別分析 (Discriminant Analysis)
The procedure DISCRIMINANT performs discriminant analysis. Discriminant
analysis is a statistical technique in which linear combinations of variables
are used to distinguish between two or more categories of cases. The variables
"discriminate" between groups of cases and predict into which category or group
a case falls, based upon the values of these variables.
The first task of discriminant analysis is to find the linear combination
of variables that best discriminates between groups. As in regression
analysis, there are two approaches to variable selection. The direct entry
method forces a set of variables into the analysis. Or, you can use
stepwise methods to find a set of variables that maximizes discriminating power
as defined by various criteria.
After the discriminant functions have been computed, you can use coefficients
to predict group membership.
The grouping variable must be categorical, and the independent (predictor)
variables must be interval or dichotomous, since they will be used in a
regression type equation.
格式
To operate, you must specify a grouping variables, and a set of discriminating
variables. Thus, only two subcommands are required: the GROUPS subcommand, and
the VARIABLES subcommand.
The GROUPS, VARIABLES and SELECT subcommands must precede any other subcommands
and may be entered in any order.
An ANALYSIS subcommand specifies the predictor variables to be used in a single
analysis. The variables must first have been named on the VARIABLES
subcommand.
All other subcommands may be entered in any order and apply only to the
preceding ANALYSIS subcommand. If any of these subcommands are entered before
the first ANALYSIS subcommand or if there is no ANALYSIS subcommand, the entire
set of variables named on VARIABLES is analyzed.
Optional output is controlled by the OPTIONS and STATISTICS.
Exam.
DISCRIMINANT GROUPS=OUTCOME (1,4)
/VARIABLES=VAR1 TO VAR7
/STATISTICS=3 8 9 11
/SAVE CLASS=PREDOUT
。Only cases for which the grouping variable GROUPS has values 1 2 3 or 4 will
be used in computing the discriminant functions.
。The variables on the active file between and including VAR1 and VAR7 will
be used to compute the discriminant functions and to classify cases.
。In addition to the default output, the STATISTICS subcommand requests the
display of the pooled within groups covariance matrix, the group and total
covariance matrices, and the unstandardized discriminant function
coefficients.
。The predicted group membership will be savee in the variable PREDOUT,
which will be added to the active file if it does not already exist.
兩個局面 Two Phases:
the analysis phase and the classification.
分析局面 (The Analysis Phase) - It is related to the calculation of the
discriminant function(s) that best distinguish the groups you have specified.
GROUPS
-
This subcommand specifies the name of the grouping variable.
VARIABLES - This subcommand identified the predictor variables.
ANALYSIS - This subcommand is to request several different discriminant
analyses using the same grouping variable, or to control the order in which
variables are entered into a stepwise analysis.
Exam.
DISCRIMINANT GROUPS=SUCCESS(0,1)
/VARIABLES=VAR10 TO VAR15,AGE,VAR5
/ANALYSIS=VAR15 TO VAR5
/ANALYSIS=ALL
The first ANALYSIS will use variables VAR15 AGE VAR5 to discriminate between
cases where SUCCESS=0 and the cases where SUCCESS=1.
The second ANALYSIS will use all variables on the VARIABLES subcommand.
進入順序 (Inclusion Levels) - When you specify a stepwise method, you can
control the order in which variables are considered for entry by specifying
inclusion levels on the ANALYSIS subcommand.
Exam.
DISCRIMINANT GROUPS=SUCCESS(0,1)
/VARIABLES=A B C D E
/ANALYSIS=A TO C(2) D E (1)
/METHOD=WILKS
。A B C are entered into the analysis first, assuming that they pass the
tolerance criterion. Since their inclusion level is even, they are entered
together.
。D E are then entered stepwise. Whichever of the two minimizes the overall
values of Wilks' lambda is entered first.
注意:
。An inclusion level is an integer between 0 and 99, specified in parentheses
after a variable or list of variables on ANALYSIS subcommand.
。Variables with higher inclusion levels are considered for entry before
variables with lower inclusion levels.
。Variables with even inclusion levels are entered as a group.
。Variables with odd inclusion levels are entered individually, according
to the stepwise method specified on the METHOD subcommand.
。Only variables with an inclusion level of 1 are considered for removal.
。Variables which fail the TOLERANCE criterion are not entered regardless of
their inclusion level.
Exam.
ANALYSIS=ALL(2)
This forces all variables into the equation. It is the
default.
ANALYSIS=ALL(1)
This yields a stepwise solution in which variables are
entered and removed in the stepwise fashion.
ANALYSIS=ALL(3)
This enters variables into the equation stepwise, but does
not ever remove variables.
ANALYSIS=ALL(2) ALL(1) This forces all variables into the equation and then
allows them to be removed stepwise if they satisfy the criterion ofr removal.
SELECT subcommand -- You can limit the discriminant analysis to cases with a
specified value on any one variable with SELECT subcommand.
Exam.
DISCRIMINANT GROUPS=APPROVAL(1,5)
/VARIABLES=Q1 TO Q10
/SELECTION=COMPLETE(1)
。Using only the cases where variable COMPLETE=1.
METHOD subcommand -- Use the METHOD subcommand to select any of six methods
for entering variables into the analysis phase. Only one METHOD may be entered
per ANALYSIS.
DIRECT - All variables passing the tolerance criteria are entered
simultaneously.
This is the defualt method.
WILKS - The variable that minimizes the overall Wilks' lambda is entered.
MAHAL - the variable that maximizes the Mahalanobis' distance between the two
closest groups is entered.
MAXMINF - The variable that maxmizes the smallest F ratio between pairs of
groups is entered.
MINRESID - The variable that minimizes the sum of the unexplained variation for
all pairs of groups is entered.
RAO - The variable that produces the largest increase in Rao's V is entered.
TOLERANCE subcommand -- It specifies the minimum tolerance a variable can have
and still be entered into the analysis.
The default is 0.001.
FIN - It specifies the minimum partial F value a variable must have to entered
the analysis. The default is FIN=0.
PIN - It specifies the minimum probability of F a variable must have to enter
the analysis. If PIN is omitted, the FIN is used.
FOUT - It is the maximum partial F a variable can have before it is removed
from the analysis. Default is 1.0. FOUT should be less than FIN if FIN is
specified.
POUT - It is the maximum probability of F a variable can have before it is
removed from the analysis. POUT should be greater than PIN, if PIN is used.
FUNCTIONS subcommand -- It specifies the number of functions obtained.
specify FUNCTIONS=nf, where nf is the number of functions desired.
STATISTICS subcommand -
You
You can request the following statistics:
1
2
3
4
5
means
standard deviations
pooled within groups covariance matrix
pooled within groups correlation matrix
matrix of pairwise F ratios.
6
7
8
9
11
12
Univariate F ratios.
Box's M test.
Group covariance matrices
Total covariance matrix
unstandardized canonical discriminant functions
classification function coefficients
OPTIONS subcommand -- it is used to reduce the amount of output produced
during the stepwise analysis.
區別局面 (classification phase) -- Once analysis phase is completed, you
can use the results to classify your cases.
PRIORS subcommand -- By default, DISCRIMINANT assumes equal probabilities
for group membership when classifying cases. You can provide different prior
probabilities with the PRIORS subcommand.
EQUAL
-- This is the default specification
SIZE
-- Proportion of the cases analyzed that fall into each group. If 50%
of the cases included in the analysis fall into the first group, 25% the
second, and 25% in the third, the prior probabilities are 0.5, 0.25, and 0.25.
value list - user specified prior probabilities. A list of probabilities
summing to 1.0 is specified.
Exam.
DISCRIMINANT GROUPS=TYPE(1,5)
/VARIABLES=A TO H
/PRIORS=.25 .2 .3 .1 .15
。Specifying a list of prior probabilities is often used to produce
classification coefficients for samples with known group membership.
Classification Options
-
Three options relating to the classification phase:
9 - classify only unselected cases
10 - classify only unclassified cases
11 - use individual group covariance matrices of the discriminant functions
for classification.
Display output - You can request a classificationresults table and three
types of plots to help you examine the efficiveness of the discriminant
analysis.
10 - territorial map
13 - classification results table
14 - casewise classification informaiton
15 - all groups plot
16 - separate groups plots
Missing values - by default, cases missing on any of the predictors are used
during neither phase.
OPTIONS 8 - substitute means for missing values during classification
OPTIONS 1 - include missing values
Save subcommand -- It allows you to add much of the casewise information
produced by STATISTICS 14 to the active file and to specify new varible names
for this information.
CLASS - save a variable containing the predicted group membership.
SCORES - save the discriminant scores.
PROBS - save each case's probabilities of membership in each group.
Exam.
DISCRIMINANT GROUPS=WORLD(1,3)
/VARIABLES=FOOD TO FSALES
/SAVE CLASS=PRDCLASS SCORES=SCORE PROBS=PRB
。With three groups, the following variables are added to each case:
PRDCLASS - predicted group
SCORE1 - discriminant score for function 1
SCORE2
PRB1 PRB2 PRO3 -
- discriminant
prob. of being
prob. of being
prob. of being
score for function 2
in group 1
in group 2
in group 3
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
DISCRIMINANT GROUPS=RACE(1,3)
/VARIABLES=NATENVIR,CAPPUN, XMOVIE
/METHOD=WILKS
STATISTICS 3 8 9 11
NUMBER OF CASES BY GROUP
NUMBER OF CASES
RACE
UNWEIGHTED
WEIGHTED
1
2
3
TOTAL
815
82
12
909
LABEL
815.0 WHITE
82.0 BLACK
12.0 OTHER
909.0
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
AT STEP
1, CAPPUN
WAS INCLUDED IN THE ANALYSIS.
DEGREES OF FREEDOM
WILKS' LAMBDA
0.98107
1
2
906.0
EQUIVALENT F
8.74182
2
906.0
---------------- VARIABLES IN THE ANALYSIS AFTER STEP
VARIABLE
TOLERANCE
F TO REMOVE
SIGNIF.
BETWEEN GROUPS
0.0002
1 ----------------
WILKS' LAMBDA
CAPPUN
1.0000000
8.7418
---------------- VARIABLES NOT IN THE ANALYSIS AFTER STEP
1 ---------------MINIMUM
VARIABLE TOLERANCE TOLERANCE F TO ENTER
WILKS' LAMBDA
NATENVIR 0.9993459 0.9993459
3.0740
XMOVIE
0.9994856 0.9994856
0.70895
119-Apr-90 SPSS-X RELEASE 3.1 FOR IBM VM/CMS
20:33:18
Ministry of Education (MOE)
IBM
0.97445
0.97953
Page
3090-120E
VM/CMS
6
R5.0
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
AT STEP
2, NATENVIR WAS INCLUDED IN THE ANALYSIS.
DEGREES OF FREEDOM SIGNIF.
BETWEEN GROUPS
WILKS' LAMBDA
0.97445
2
2
906.0
EQUIVALENT F
5.89437
4
1810.0 0.0001
---------------- VARIABLES IN THE ANALYSIS AFTER STEP
2 ----------------
VARIABLE
TOLERANCE
F TO REMOVE
WILKS' LAMBDA
NATENVIR 0.9993459
3.0740
0.98107
CAPPUN
0.9993459
8.5195
0.99279
---------------- VARIABLES NOT IN THE ANALYSIS AFTER STEP
2 ---------------MINIMUM
VARIABLE TOLERANCE TOLERANCE F TO ENTER
WILKS' LAMBDA
XMOVIE
0.9822323
0.9820949
1.0004
0.97230
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
AT STEP
3, XMOVIE
WAS INCLUDED IN THE ANALYSIS.
DEGREES OF FREEDOM SIGNIF.
BETWEEN GROUPS
WILKS' LAMBDA
0.97230
3
2
906.0
EQUIVALENT F
4.26286
6
1808.0 0.0003
----------------- VARIABLES IN THE ANALYSIS AFTER STEP
3 ---------------VARIABLE
TOLERANCE
F TO REMOVE
NATENVIR
CAPPUN
XMOVIE
0.9820949
0.9986569
0.9822323
3.3644
8.3293
1.0004
WILKS' LAMBDA
0.97953
0.99021
0.97445
F LEVEL OR TOLERANCE OR VIN INSUFFICIENT FOR FURTHER COMPUTATION.
SUMMARY TABLE
ACTION
VARS
STEP ENTERED REMOVED
IN
1
2
3
CAPPUN
NATENVIR
XMOVIE
SIG.
LABEL
1
.98107 .0002 DO YOU FAVOR DEATH PENALTY
2
.97445 .0001 SPEND $ - ENVIRONMENT
3
.97230 .0003 EVER SEEN X-RATED MOVIE
CANONICAL DISCRIMINANT FUNCTIONS
PCT OF
FCN EIGENVALUE VARIANCE
1*
0.0253
2*
0.0031
* MARKS THE
WILKS'
LAMBDA
CUM
PCT
CANONICAL
CORR
AFTER
FCN
WILKS'
LAMBDA
CHISQUARE
NATENVIR
CAPPUN
XMOVIE
SIG
:
0 0.9723
25.426
6 0.0003
88.93
88.93
0.1570 :
1 0.9969
2.841
2 0.2416
11.07 100.00 0.0560 :
2 CANONICAL DISCRIMINANT FUNCTIONS REMAINING IN THE ANALYSIS.
STANDARDIZED CANONICAL DISCRIMINANT FUNCTION COEFFICIENTS
FUNC
DF
1
-0.44956
0.84374
0.30074
FUNC
2
0.90054
0.42742
0.07819
STRUCTURE MATRIX:
POOLED WITHIN-GROUPS CORRELATIONS BETWEEN DISCRIMINATING VARIABLES
AND CANONICAL DISCRIMINANT FUNCTIONS
(VARIABLES ORDERED BY SIZE OF CORRELATION WITHIN FUNCTION)
FUNC 1
FUNC 2
CAPPUN
XMOVIE
NATENVIR
0.86205*
0.26111*
-0.43182
0.40616
0.20561
0.89983*
UNSTANDARDIZED CANONICAL DISCRIMINANT FUNCTION COEFFICIENTS
FUNC
1
FUNC
2
NATENVIR -0.5262835
CAPPUN
1.916619
XMOVIE
0.7166166
(CONSTANT) -3.124272
1.054227
0.9709133
0.1863149
-2.722568
CANONICAL DISCRIMINANT FUNCTIONS EVALUATED AT GROUP MEANS (GROUP CENTROIDS)
GROUP
FUNC
1
FUNC
2
1
2
-0.05260
0.49723
0.00415
0.02905
3
0.17472
-0.48006
N. FACTOR
FACTOR produces principal components analysis results
factor analysis results.
and
There are no limitations to the number of analyses, the
number of variables, the number of extrations, or the number of
rotations.
You can choose from among six extration techniques.
of
You can control the number of factors extracted, the number
iterations for extration and rotation, and other rotation
parameters.
You can calculate factor scores and save them on the
active
file.
Four Step Processes:
(1) Decide on the variables you wish
variables are treated as dependent variables.
to
analyze.
All
(2) Decide on an extration technique - principal components
analysis or factor analysis.
If the factor analysis, you must
choose from among the extration techniques available.
(3) Decide on a rotation technique.
orthogonal and oblique rotations.
FACTOR provides several
(4) Decide whether you want to save factor scores from the
analysis.
Three methods of calculating factor scores are
available.
Four Blocks Subcommands:
(1) Variable selection Block;
The VARIABLES, MISSING, and WIDTH subcommands can be entered
in Variable selection Block.
***
VARIABLES
***
It is the only required subcommand in FACTOR.
Exam.
FACTOR SATIS1, SATIS2 TO SATIS10/
*
It produces the default principle components analysis
10 scales items.
of
* Keyword ALL can abe used to reference all variables on the
active file.
* Variables must be numeric.
* Only one VARIABLE subcommand is permitted.
***
MISSING
To
***
select the missing value treatment,
specify one of
the
following keywords on the MISSING subcommand:
LISTWISE - delete missing values listwise.
The same effect
as Default.
PAIRWISE - delete missing values pairwise.
MEANSUB - replace missing values with the variable mean.
INCLUDE - include missing values.
DEFAULT - delete missing values listwise.
Exam.
FACTOR VARIABLES=V1 TO V10/
MISSING = MEANSUB/
* use mean substitution for missing values.
***
WIDTH
***
You can control the width of the output from FACTOR.
The
default width is 132 characters, but you can specify any width
from 72 to 132.
Exam.
FACTOR VARIABLES = V1 TO V10/
MISSING = MEANSUB/
WIDTH = 100/
(2) Extration Block;
The following subcommands can be applied to extration block
subcommand:
ANALYSIS, EXTRACTION, PRINT, FORMAT, PLOT, and
CRITERIA.
***
ANALYSIS
***
The subcommand is used to specify a subset of the variables
named on the VARIABLES subcommand.
Exam.
FACTOR VARIABLES=X1 TO X10/
ANALYSIS = X1 TO X8/
* It restricts the analysis to variables X1 to X8.
* If you omit the ANALYSIS
variables named on the VARIABLES.
subcommand,
FACTOR
uses
all
* You can use more than one ANALYSIS subcommand.
Exam.
FACTOR VARIABLES=V1 TO V10/
ANALYSIS = V1 5O V5/
ANALYSIS = V6 TO V10/
* It specifies two complete analyses.
***
EXTRACTION
***
You use one of the following keywords to specify the factor
extraction technique.
PC - principal components analysis
PA1 - principal components analysis; equivalent to PC
PAF - principal axis factoring
PA2 - principal axis factoring; equivalent to PAF
ALPHA - alpha factoring
IMAGE - image factoring
ULS - unweighted least squares
GLS - generalized least squares
ML - maximum likelihood
DEFAULT - default is principal components analysis
Exam.
FACTOR VARIABLES=V1 TO V10/
EXTRACTION=PC/
EXTRACTION=ML
* You can
given analysis.
***
PRINT
You
specify more than one extraction method
for
a
***
use
the
PRINT subcommand and
any
of
the
following
keyword specifications to print results.
UNIVARIATE - means, standard deviations
INITIAL - initial
communalities,
eigenvalues
correlation matrix, and percent of variance explained
of
the
CORRELATION - correlation matrix
SIG - significance levels of correlations
DET - the determinant of the correlation matrix
INV - inverse of the correlation matrix
AIC - the anti image covariance and correlation matrices
KMO - the Kaiser Meyer Olkin measure of
and Bartlett's test of sphericity.
EXTRACTION - communalities,
factor loadings
sampling
eigenvalues,
and
adequacy
unrotated
REPR - reproduced correlations and residual correlations
the
ROTATION - rotated factor pattern and structure matrices,
factor transformation matrix, and the factor correlation
matrix
FSCORE - the factor score coefficient matrix
ALL - all available statistics
DEFAULT - specifies INITIAL, EXTRACTION, and ROTATION
Exam.
FACTOR VARIABLES=V1 TO V10/
PRINT=AIC KMO REPR/
EXTRACTION=ML/
ROTATION=VARIMAX
***
FORMAT
***
The FORMAT subcommand reformats the factor
structure matrices to ease interpretability.
loading
SORT - order the factor loadings by maghnitude.
identifying cluster of variables.
BLANK(n) - suppress
than n.
coefficients lower in
and
It aids in
absolute
DEFAULT - deactivate blanking and sorting.
appear in the order in which they are named.
value
Variables
Exam.
FACTOR VARIABLES=V1 TO V10/
FORMAT = SORT BLANK (.3)/
EXTRACTION=ULS/
* It specifies that loadings be ordered by magnitude
that loadings smaller in magnitude than .03 not be printed.
***
PLOT
and
***
It is to obtain a scree plot (in descending order) or a plot
of the variables in rotated factor space.
The
needed.
scree
plot aids in identifying the number
of
factors
EIGEN - plots the eigenvalues in descending order.
ROTATION
(n1
n2)
- plot the variables
in
factor
space.
Specify n1 and n2 which are the numbers to be plotted.
Exam.
FACTOR VARIABLES=V1 TO V10/
PLOT=EIGEN/
EXTRACTION=ULS/
ROTATION=VARIMAX
***
CRITERIA
***
It is to override extraction and rotation defaults.
You can
specify one CRITERIA for each extraction.
FACTORS(nf) - the number of factors extracted.
the number of eigenvalues greater than MINEIGEN.
Default
is
MINEIGEN(eg) - minimum eigenvalue used to control the number
of factors. Default value is 1.
ITERATE(ni) - the number
solution. Default value is 25.
of
iterations
for
ECONVERGE(e1) - the
Default value is 0.001.
convergence criterion for
RCONVERGE(e2) - the
Default value is 0.001.
convergence
criterion
the
factor
extraction.
for
rotation.
DELTA(d) - the value of delta for direct oblimin
Default value is 0.
rotation.
KAISER - Kaiser normalization; the default.
NOKAISER - no Kaiser normalization
DEFAULT - see above for each default value.
Exam.
CRITERIA = ITERATE (10)/
EXTRACTION=ULS/
***
DIAGONAL
***
It is to specify initial diagonal values in conjunction with
principal axis factoring.
You specify one of the following:
valuelist - diagonal values; user supplied diagonal values.
DEFAULT - 1 is on the diagonal for principal components or
initial communality estimates on the diagonal for factor methods.
Exam.
FACTOR VARIABLES=V1 TO V4/
DIAGONAL = .55 .45 .35 .40/
EXTRACTION = PAF/
ROTATION = VARIMAX
(3) The ROTATION Block
If you do not use the
rotation method is VARIMAX.
EXTRACTION,
the
default
factor
If you use the EXTRACTION, but do not use the ROTATION, the
factor loadings are not rotated.
Keyword:
VARIMAX - varimax rotation
EQUAMAX - equamax rotation
QUARTIMAX - quartimax rotation
OBLIMIN - direct oblimin rotation
NOROTATE - no rotation
DEFAULT - the default is varimax rotation
Exam.
FACTORS VARIABLES = V1 TO V10/
EXTRACTION=ULS/
ROTATION/
* It specifies varimax rotation.
Exam.
FACTORS VARIABLES = V1 TO V5/
EXTRACTION=ML/
ROTATION=QUARTIMAX/
ROTATION=OBLIMIN/
ROTATION=VARIMAX/
* It specifies 3 different rotations.
(4) Save Block.
You use SAVE to compute and save factor scores on the active
file.
You choose one of the following method keywords:
REG - the Regression method
BART - the Bartlett method
AR - the Anderson Rubin method
DEFAULT - the default is the regression method
Exam.
FACTOR VARIABLES=V1 TO V10/
CRITERIA=FACTORS(2)/
EXTRACTION=ULS/
ROTATION=VARIMAX/
SAVE AR (ALL FSULS)/
*
using
file.
It calculates two factor scores named FSULS1 and FSULS2
the Anderson Rubin method and saves them on the active
* Note: The parentheses are required.
Exam.
FACTOR VARIABLES=V1 TO V10/
CRITERIA=FACTORS(2)/
EXTRACTION=ULS/
ROTATION=VARIMAX/
SAVE AR (ALL FSULS)/
SAVE BART (ALL BFAC)
* It saves two sets of factor scores.
* The first set is using the Anderson Rubin method.
scores named FSULS1 and FSULS2.
Factor
* The second set is using Bartlett method.
named BFAC1 and BFAC2.
scores
Factor
***
WRITE
***
It is to write the correlation matrix or the factor loadings
to a specified file.
Keywords:
CORRELATION - write the correlation matrix
FACTOR - write the factor matrix
DEFAULT - write the correlation matrix
* You must use a FILE HANDLE command to define a handle for
the file containing matrix materisl, a PROCEDURE OUTPUT command
to signal matrix out, and the WRITE subcommand.
FILE HANDLE GSS80/ NAME='SYS1'
FILE HANDLE MATOUT/ NAME='MATDATA'
GET FILE=GSS80
PROCEDURE OUTPUT OUTFILE=MATOUT
FACTOR VARIABLES=CONBUS TO CONARMY/
WRITE CORRELATION
* Write
MATOUT.
the correlation matrix to the file
referenced
by
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
FACTOR VARIABLES=HAPPY SATFAM SATFRND SATJOB SATFIN
/EXTRATION=ML
/ROTATION=OBLIMIN
INITIAL STATISTICS:
VARIABLE
COMMUNALITY
HAPPY
SATFAM
SATFRND
SATJOB
* FACTOR
*
.22419 *
1
.25106 *
2
.24588 *
3
.02935 *
4
EIGENVALUE
PCT OF VAR
1.97474
1.02391
.84407
.62170
39.5
20.5
16.9
12.4
SATFIN
.14010 *
5
.53558
10.7
ML ATTEMPTED TO EXTRACT
2 FACTORS.
MORE THAN
25 ITERATIONS REQUIRED. CONVERGENCE =
.00614
CHI-SQUARE STATISTIC:
2.6219, D.F.:
1, SIGNIFICANCE:
FACTOR MATRIX:
CUM PCT
39.5
60.0
76.9
89.3
100.0
0.1054
FACTOR
HAPPY
SATFAM
SATFRND
SATJOB
SATFIN
1
.48061
.39379
.41347
.18152
.84174
FACTOR
2
.27676
.60451
.47241
-.01661
-.26495
FINAL STATISTICS:
VARIABLE
COMMUNALITY
HAPPY
SATFAM
SATFRND
.30767
.52053
.39413
- - - - - - - - - - -
VARIABLE
F A C T O R
COMMUNALITY
*
.03328
.77873
*
*
SATJOB
SATFIN
BLIMIN
* FACTOR
*
*
1
*
2
*
ROTATION
1
FACTOR
HAPPY
SATFAM
SATFRND
SATJOB
SATFIN
1
.21780
-.09055
.02051
.16852
.91532
1.29849
.73568
26.0
14.7
EIGENVALUE
1
5 ITERATIONS.
PATTERN MATRIX:
FACTOR
PCT OF VAR
A N A L Y S I S
FOR EXTRACTION
OBLIMIN CONVERGED IN
EIGENVALUE
FACTOR
2
.42156
.75755
.61833
.02705
-.07961
26.0
40.7
- - - - - - - - - - -
PCT OF VAR
IN ANALYSIS
CUM PCT
CUM PCT
1 - KAISER NORMALIZATION.
STRUCTURE MATRIX:
FACTOR
HAPPY
SATFAM
SATFRND
SATJOB
SATFIN
1
.40703
.24950
.29807
.18066
.87958
FACTOR
2
.51932
.71691
.62753
.10270
.33126
FACTOR CORRELATION MATRIX:
FACTOR
FACTOR
FACTOR
1
2
1
1.00000
.44888
FACTOR
2
1.00000
O. RELIABILITY
It performs an item analysis on the components of additive
scales by computing commonly used coefficients of reliability.
To use RELIABILITY you must specify a set of variables from which an
intermediate matrix is computed, a scale which references variables in the
matrix, and a particular model.
You can specify multiple sets of variables, multiple scales, and multiple
models.
Exam.
RELIABILITY VARIABLES=ITEM1 TO ITEM5
/SCALE(TESTSCOR)=ITEM1 TO ITEM5
。This will produce the default display, including list of variables,
their associated labels, the number of valid cases, number of items, and
Cronbach's Alpha.
The VARIABLES Subcommand
It specifies
SCALE subcommands.
all the variables to be named on one or
more
The SCALE Subcommand
It specifies the scale to be tested.
The SCALE subcommand
has an arbitrary scale name in parentheses followed by the set of
variables composing the scale.
Exam.
RELIABILITY VARIABLES=ITEM1 TO ITEM5/
SCALE(RATING)=ITEM1 TO ITEM5/
* The scale name can be a maximum of 8 characters and
be composed of the letters A to Z and digits 0 to 9.
must
The MODEL Subcommand
The MODEL specifies the type of reliability
follows the SCALE subcommand to which it applies.
Exam.
RELIABILITY VARIABLES=ITEM1 TO ITEM5/
SCALE(RATING)=ITEM1 TO ITEM5/
MODEL=SPLIT
analysis
and
The following five types of reliability analyses are available:
ALPHA - Cronbach's alpha and standardized item alpha.
default is ALPHA.
The
SPLIT(n) - split half coefficients
GUTTMAN - guttman's lower bounds for true reliability
PARALLEL - maximum
likelihood reliability
estimate
under
parallel assumptions
STRICTPARALLEL - maximum
likelihood
reliability
estimate
under strictly parallel assumptions
Optional Statistics
RELIABILITY
also computes descriptive
statistics
for
variables forming the scale and summary statistics for the scale.
STATISTIC 1 - item means and standard deviations
STATISTIC 2 - inter item variance covariance matrix
STATISTIC 3 - inter item correlations
STATISTIC 4 - scale means and scale variances
STATISTIC 5 - summary statistics for item mean
STATISTIC 6 - summary statistics for item variance
STATISTIC 7 - summary statistics for inter item covariances
STATISTIC 8 - summary statistics for inter item correlations
STATISTIC 9 - item total statistics
The OPTIONS subcommand
OPTION 1
OPTION 3
-
including missing values
suppress variable labels
Limitations:
* maximum of 10 VARIABLES subcommands.
* maximum of 50 SCALE subcommands.
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
RELIABILITY VARIABLES=HAPPY SATFAM SATFRND SATJOB SATFIN
/SCALE(SATSCALE)=HAPPY SATFAM SATFRND SATJOB SATFIN
/MODEL=ALPHA
STATISTICS 8
****** METHOD 2 (COVARIANCE MATRIX) WILL BE USED FOR THIS ANALYSIS ******
R E L I A B I L I T Y
1.
2.
3.
4.
5.
HAPPY
SATFAM
-
S C A L E
SATISFIED WITH THE FRIENDSHIP
SATISFIED WITH THE WORK YOU DO
SATISFIED WITH FINANCIAL SITUATION
965.0
MEAN
MINIMUM
MAXIMUM
RANGE
.2232
.0447
.4482
.4035
VARIANCE
10.0369
(S A T S C A L E)
TAKEN ALL TOGETHER ARE YOU HAPPY
SATISFIED WITH FAMILY LIFE
SATFRND
SATJOB
SATFIN
# OF CASES =
INTER-ITEM
CORRELATIONS
A N A L Y S I S
.0178
RELIABILITY COEFFICIENTS
ALPHA =
.5676
5 ITEMS
STANDARDIZED ITEM ALPHA =
.5896
MAX/MIN
拾壹、WRITE 指令 (Write Cases)
The WRITE command is designed for writing data to be read by
other softward rather than by people.
The WRITE command operates the same as the PRINT command
except that no blank columns are inserted automatically between
variables, the system missing value is represented by blanks, and
you can write lines longer than 255 characters.
Exam.
FILE HANDLE NEWHUB/ NAME='HUBDAT'
WRITE OUTFILE=NEWHUB TABLE
/EMPLOYID '1' MOHIRED YRHIRED SEX AGE JOBCAT NAME
/EMPLOYID '2' DEPT79 TO DEPT82 SALARY 79 TO SALARY82 *
HURLRY82 (F5.2)
EXECUTE
* You specifies two records per input case, and a format for
variable HOURLY82 to override the F7.2 dictionary format.
* TABLE requests a format table on the display file showing
how the variable information is formatted.
NOTABLE is the
default.
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS
FILE HANDLE SATDAT/NAME='SAT DATA A1'
SAMPLE .05
WRITE OUTFILE=SATDAT TABLE
/1 YEAR 1-2 MARITAL 3 RACE 4 SEX 5 AGE 6-7 CHILDS 8
HAPPY 9 SATFAM 10 SATFRND 11 SATJOB 12 SATFIN 13
EXECUTE
7611224322512
7611262612112
7621274221201
7621189821102
7611246111113
7651219022241
7611151022112
7642160822202
7642229122403
7611224311432
7611228122211
7611233212422
7621256124331
7611138211111
7633148826223
7631141722103
7611130111221
7611230312222
7611245311122
7651222021202
7642258222212
7611138512213
7621272522201
7611257122222
7611155322301
7641230434313
7611235522233
7651273023301
7621181112201
7611167231301
7622153431122
7622253623322
7611151011211
7651119032303
7621185322202
8621271022411
8652241024411
8652225022223
8631256322123
8611243012211
8611254311111
8651124011413
8611151311112
8621270223222
8611140221222
8611225421223
8641229222223
8651127212213
8611154622412
8611229122312
8611230024322
8611164111212
8651222022203
8611151211211
8611134111121
拾貳、系統檔 (system files)
Variables created or altered by data transformations and the
descriptive information for these variables can also be saved on
a system file.
You can access the system file on subsequent SPSSx jobs or
later in the same job without respecifying variable locations,
formats, missing values, or variable and value labels.
You can update the system file and save the updated version
in a new system file.
Exam.
SAVE OUTFILE=HUBEMPL
* To specify the file handle of the system file to be saved.
Exam.
GET FILE = HUBEMPL
* To read the previously saved system file.
MATCH FILES - The command combines variables from parallel,
nonparallel, and table lookup files into one file.
ADD FILE - The command combines cases from two or more files
by concatenating or interleaving the cases.
FILE HANDLE GSSSYS/NAME='GSS SYS A1'
GET FILE=GSSSYS/MAP
File GSS SYS A1
Created: 04-APR-90 20:52:32 - 50 variables
FILE MAP
Result
Input1
----------YEAR
YEAR
INCOME
INCOME
PRESTIGE PRESTIGE
PAPRES16 PAPRES16
MARITAL
MARITAL
SIBS
SIBS
ZODIAC
ZODIAC
DEGREE
DEGREE
Result
-----ATTEND
MAWORK
RACLIVE
NATENVIR
NATEDUC
NATFARE
NATCRIME
NATDRUG
Input1
-----ATTEND
MAWORK
RACLIVE
NATENVIR
NATEDUC
NATFARE
NATCRIME
NATDRUG
Result
-----CONPRESS
CONLEGIS
AGED
DIVLAW
PORNMORL
PORNRAPE
PORNOUT
PORNINF
Input1
-----CONPRESS
CONLEGIS
AGED
DIVLAW
PORNMORL
PORNRAPE
PORNOUT
PORNINF
RACE
CAPPUN
CAPPUN
XMOVIE
XMOVIE
RACE
SEX
AGE
CHILDS
REGION
SIZE
POLVIEWS
PARTYID
RELIG
SEX
AGE
CHILDS
REGION
SIZE
POLVIEWS
PARTYID
RELIG
GRASS
BUSING
HAPPY
SATFAM
SATFRND
SATJOB
SATFIN
CONEDUC
GRASS
BUSING
HAPPY
SATFAM
SATFRND
SATJOB
SATFIN
CONEDUC
CHLDIDEL
HIT
HITOK
COURTS
USINTL
POSTLIFE
HELPFUL
CHLDIDEL
HIT
HITOK
COURTS
USINTL
POSTLIFE
HELPFUL
Download