|
Hello,
I have to find a count of each variables within absolute 5, 10, 15 & 20%. I
came up with idea using 'Compute' and writing a formula that gives me 1 for
true value and 0 for false. Then I can run 'case summaries' and count the
sum for each VAR. I'm still looking for easier way to calculate this.
My problem is, I need to present a ratio (counts within 5, 10, 15 & 20% to
the sum of counts for each VAR).
I figured I can run a report 'in columns' but that gives me only one ratio -
between two variables. How can I get a ratio for VAR1 within 5, 10, 15 &
20%, VAR2 within 5, 10, 15 & 20% etc.. at once, on the same report?
Syntax:
SORT CASES BY State (A) .
Report
/FORMAT= CHWRAP(ON) BRKSPACE(-1) SUMSPACE(0) AUTOMATIC
PREVIEW(OFF) CHALIGN(BOTTOM) CHDSPACE(1)
UNDERSCORE(ON) ONEBREAKCOL(OFF)
PAGE(1) MISSING'.' LENGTH(1, 59)ALIGN(LEFT) TSPACE(1) FTSPACE(1)
MARGINS(1,74)
/TITLE=
RIGHT 'Page )PAGE'
/VARIABLES
VP4_5 'VP4_5' 'Sum' (RIGHT) (OFFSET(0)) (10)
VP4_10 'VP4_10' 'Sum' (RIGHT) (OFFSET(0)) (10)
VP4_15 'VP4_15' 'Sum' (RIGHT) (OFFSET(0)) (10)
VP4_20 'VP4_20' 'Sum' (RIGHT) (OFFSET(0)) (10)
Var 'Var%' 'N' (RIGHT) (OFFSET(0))(8)
$dummy01 (DUMMY) 'Total' (RIGHT) (OFFSET(0))(6)
/BREAK (TOTAL)
/SUMMARY SUM(VP4_5) SUM(VP4_10) SUM(VP4_15) SUM(VP4_20) VALIDN(Var)
PCT( SUM(VP4_20) VALIDN(Var) ) ($dummy01
(PCT)(0)) 'Grand Total' (1)
/BREAK State (LABELS) (LEFT) (OFFSET(0)) (SKIP(1))(8)
/SUMMARY SUM(VP4_5) SKIP(0) SUM(VP4_10) SUM(VP4_15) SUM(VP4_20) VAL
IDN(Var) PCT( SUM(VP4_20) VALIDN(Var) )
($dummy01(PCT)(0)).
My sample size is usually couple thousands.
Example:
VAR1
VAR2
VAR3
-3%
1%
0%
2%
-3%
-1%
11%
10%
13%
25%
20%
22%
65%
70%
60%
-8%
-12%
-6%
17%
15%
14%
|