-
Notifications
You must be signed in to change notification settings - Fork 1
/
HELP_univariate_SPSSsyntax.sps
110 lines (86 loc) · 2.36 KB
/
HELP_univariate_SPSSsyntax.sps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
* Encoding: UTF-8.
* ========================================
* N736 - Univariate Stats
*
* Melinda Higgins, PhD
* updated 09/26/2018
* ========================================.
* Analyze/Descriptive Statistics/Frequencies
* Useful for getting manu descriptive stats
* and get frequencies and histograms.
FREQUENCIES VARIABLES=age pcs mcs cesd
/NTILES=4
/STATISTICS=STDDEV MINIMUM MAXIMUM MEAN
/HISTOGRAM
/ORDER=ANALYSIS.
* Analyze/Descriptive Statistics/Descriptives
* Useful for getting basic descriptive stats
* and compute Z-scores if needed.
DESCRIPTIVES VARIABLES=age pcs mcs cesd
/SAVE
/STATISTICS=MEAN STDDEV MIN MAX.
* Analyze/Descriptive Statistics/Explore
* also get descriptive stats
* can get confidence intervals
* also normal probability plots
* and tests for normality.
EXAMINE VARIABLES=age pcs mcs cesd
/PLOT BOXPLOT HISTOGRAM NPPLOT
/COMPARE GROUPS
/STATISTICS DESCRIPTIVES
/CINTERVAL 95
/MISSING PAIRWISE
/NOTOTAL.
* easy to add a group variable to the EXPLORE
* EXAMINE procedure to get stats by group.
EXAMINE VARIABLES=age pcs mcs cesd BY treat
/PLOT BOXPLOT HISTOGRAM NPPLOT
/COMPARE GROUPS
/STATISTICS DESCRIPTIVES
/CINTERVAL 95
/MISSING PAIRWISE
/NOTOTAL.
* for the other SPSS procedures
* FREQUENCIES and DESCRIPTIVES
* you need to first - SPLIT the data
* then run the procedure
* and REMEMBER to turn the SPLIT off.
* SPLIT applied to run FREQUENCIES.
SORT CASES BY treat.
SPLIT FILE LAYERED BY treat.
FREQUENCIES VARIABLES=age pcs mcs cesd
/NTILES=4
/STATISTICS=STDDEV MINIMUM MAXIMUM MEAN
/HISTOGRAM
/ORDER=ANALYSIS.
SPLIT FILE OFF.
* SPLIT applied to run DESCRIPTIVES.
SORT CASES BY treat.
SPLIT FILE LAYERED BY treat.
DESCRIPTIVES VARIABLES=age pcs mcs cesd
/SAVE
/STATISTICS=MEAN STDDEV MIN MAX.
SPLIT FILE OFF.
* Categorical and Ordinal Data
* use CROSSTABs to get frequencies
* by Group.
* Basic counts.
CROSSTABS
/TABLES=female racegrp homeless f1a BY treat
/FORMAT=AVALUE TABLES
/CELLS=COUNT
/COUNT ROUND CELL.
* add percentages within Columns.
CROSSTABS
/TABLES=female racegrp homeless f1a BY treat
/FORMAT=AVALUE TABLES
/CELLS=COUNT COLUMN
/COUNT ROUND CELL.
* add chi-square tests and
* fisher's exact tests if needed (2-x-2 tables).
CROSSTABS
/TABLES=female racegrp homeless f1a BY treat
/FORMAT=AVALUE TABLES
/STATISTICS=CHISQ
/CELLS=COUNT COLUMN
/COUNT ROUND CELL.