done
done > ctables.txt
-AT_DATA([ctables.sps],
-[[DATA LIST LIST NOTABLE FILE='ctables.txt'
- /w (F5.0) a b c (f2.0).
-VAR LEVEL w c (SCALE) a b (NOMINAL).
-MISSING VALUES a b (9).
-
-* Use SPLIT FILE with FREQUENCIES to generate output equivalent to
+AT_DATA([analysis.sps],
+[[* Use SPLIT FILE with FREQUENCIES to generate output equivalent to
CTABLES later, to make the results easier to verify.
SPLIT FILE BY a b.
FREQUENCIES
/SLABELS POSITION=ROW
/CATEGORIES VARIABLES=a b MISSING=INCLUDE.
]])
+
+AT_DATA([ctables.sps],
+[[DATA LIST LIST NOTABLE FILE='ctables.txt'
+ /w (F5.0) a b c (f2.0).
+VAR LEVEL w c (SCALE) a b (NOMINAL).
+MISSING VALUES a b (9).
+
+INCLUDE 'analysis.sps'.
+
+WEIGHT BY w.
+INCLUDE 'analysis.sps'.
+
+* Same as original analysis using unweighted versions of summaries.
+CTABLES
+ /TABLE c[UVALIDN, UMISSING, UMEAN F8.2, USEMEAN F8.2, UMEDIAN F8.2, UMODE, USTDDEV F8.2, UVARIANCE F8.2, USUM F8.2, UCOUNT, UTOTALN, ULAYERROWPCT.SUM] BY a>b
+ /SLABELS POSITION=ROW
+ /CATEGORIES VARIABLES=a b MISSING=INCLUDE.
+]])
AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
Statistics
╭─────────┬──────────────────────────────────────────────────────────────╮
│ Sum │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
│ Count │ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│
│ Total N │ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│
-│ Layer Row Sum % │ xxxx%│ xxxx%│ xxxx%│ xxxx%│ xxxx%│ xxxx%│ xxx8%│ xxxx%│ xxxx%│
+│ Layer Row Sum % │ 26.3%│ 21.3%│ .│ 26.3%│ 26.1%│ .│ .│ .│ .│
╰───────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
+
+ Statistics
+╭─────────┬─────────────────────────────────────────────────────────────────╮
+│ │ a │
+│ ├─────────────────────┬─────────────────────┬─────────────────────┤
+│ │ 1 │ 2 │ 9 │
+│ ├─────────────────────┼─────────────────────┼─────────────────────┤
+│ │ b │ b │ b │
+│ ├───────┬──────┬──────┼──────┬───────┬──────┼──────┬──────┬───────┤
+│ │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │
+│ ├───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│ │ c │ c │ c │ c │ c │ c │ c │ c │ c │
+├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│N Valid │ 40│ 35│ 41│ 26│ 38│ 40│ 34│ 32│ 39│
+│ Missing│ 6│ 14│ 11│ 22│ 13│ 7│ 16│ 21│ 10│
+├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│Mean │ 27.23│ 24.20│ 22.63│ 27.96│ 27.21│ 23.48│ 23.71│ 25.47│ 26.03│
+├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│S.E. Mean│ .93│ .75│ 1.03│ 1.12│ .84│ .87│ 1.01│ 1.05│ 1.01│
+├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│Median │ 30.00│ 22.00│ 19.00│ 30.00│ 29.00│ 24.00│ 23.00│ 24.00│ 28.00│
+├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│Mode │ 34│ 29│ 19│ 34│ 33│ 28│ 23│ 18│ 30│
+├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│Std Dev │ 5.89│ 4.42│ 6.59│ 5.69│ 5.16│ 5.50│ 5.87│ 5.94│ 6.30│
+├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│Variance │ 34.64│ 19.52│ 43.39│ 32.36│ 26.66│ 30.20│ 34.46│ 35.29│ 39.71│
+├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│Range │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
+├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│Minimum │ 16│ 18│ 15│ 16│ 18│ 15│ 16│ 18│ 15│
+├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│Maximum │ 34│ 31│ 35│ 34│ 33│ 35│ 34│ 33│ 35│
+├─────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│Sum │1089.00│847.00│928.00│727.00│1034.00│939.00│806.00│815.00│1015.00│
+╰─────────┴───────┴──────┴──────┴──────┴───────┴──────┴──────┴──────┴───────╯
+
+ Custom Tables
+╭───────────────────┬─────────────────────────────────────────────────────────────────╮
+│ │ a │
+│ ├─────────────────────┬─────────────────────┬─────────────────────┤
+│ │ 1 │ 2 │ 9 │
+│ ├─────────────────────┼─────────────────────┼─────────────────────┤
+│ │ b │ b │ b │
+│ ├───────┬──────┬──────┼──────┬───────┬──────┼──────┬──────┬───────┤
+│ │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │
+├───────────────────┼───────┼──────┼──────┼──────┼───────┼──────┼──────┼──────┼───────┤
+│c Valid N │ 40│ 35│ 41│ 26│ 38│ 40│ 34│ 32│ 39│
+│ Missing │ 6│ 14│ 11│ 22│ 13│ 7│ 16│ 21│ 10│
+│ Mean │ 27.22│ 24.20│ 22.63│ 27.96│ 27.21│ 23.48│ 23.71│ 25.47│ 26.03│
+│ Std Error of Mean│ .93│ .75│ 1.03│ 1.12│ .84│ .87│ 1.01│ 1.05│ 1.01│
+│ Median │ 30.00│ 22.00│ 19.00│ 30.00│ 29.00│ 24.00│ 23.00│ 24.00│ 28.00│
+│ Mode │ 34│ 29│ 19│ 34│ 33│ 28│ 23│ 18│ 30│
+│ Std Deviation │ 5.89│ 4.42│ 6.59│ 5.69│ 5.16│ 5.50│ 5.87│ 5.94│ 6.30│
+│ Variance │ 34.64│ 19.52│ 43.39│ 32.36│ 26.66│ 30.20│ 34.46│ 35.29│ 39.71│
+│ Range │ 18.00│ 13.00│ 20.00│ 18.00│ 15.00│ 20.00│ 18.00│ 15.00│ 20.00│
+│ Minimum │ 16│ 18│ 15│ 16│ 18│ 15│ 16│ 18│ 15│
+│ Maximum │ 34│ 31│ 35│ 34│ 33│ 35│ 34│ 33│ 35│
+│ Sum │1089.00│847.00│928.00│727.00│1034.00│939.00│806.00│815.00│1015.00│
+│ Count │ 46│ 49│ 52│ 48│ 51│ 47│ 50│ 53│ 49│
+│ Total N │ 46│ 49│ 52│ 48│ 51│ 47│ 50│ 53│ 49│
+│ Layer Row Sum % │ 29.5%│ 22.9%│ .│ 19.7%│ 28.0%│ .│ .│ .│ .│
+╰───────────────────┴───────┴──────┴──────┴──────┴───────┴──────┴──────┴──────┴───────╯
+
+ Custom Tables
+╭────────────────────────────┬──────────────────────────────────────────────────────────────╮
+│ │ a │
+│ ├────────────────────┬────────────────────┬────────────────────┤
+│ │ 1 │ 2 │ 9 │
+│ ├────────────────────┼────────────────────┼────────────────────┤
+│ │ b │ b │ b │
+│ ├──────┬──────┬──────┼──────┬──────┬──────┼──────┬──────┬──────┤
+│ │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │ 3 │ 4 │ 9 │
+├────────────────────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤
+│c Valid N │ 7│ 6│ 8│ 7│ 7│ 8│ 7│ 7│ 8│
+│ Missing │ 3│ 4│ 2│ 3│ 3│ 2│ 3│ 3│ 2│
+│ Unweighted Mean │ 25.86│ 24.50│ 24.63│ 25.86│ 25.71│ 24.25│ 25.43│ 25.29│ 23.88│
+│ Std Error of Mean │ 2.44│ 2.14│ 2.58│ 2.44│ 2.18│ 2.43│ 2.36│ 2.18│ 2.47│
+│ Median │ 25.00│ 24.50│ 25.00│ 25.00│ 27.00│ 25.00│ 25.00│ 24.00│ 23.50│
+│ Mode │ 16│ 18│ 15│ 16│ 18│ 15│ 16│ 18│ 15│
+│ Std Deviation │ 6.47│ 5.24│ 7.31│ 6.47│ 5.77│ 6.88│ 6.24│ 5.77│ 6.98│
+│ Variance │ 41.81│ 27.50│ 53.41│ 41.81│ 33.24│ 47.36│ 38.95│ 33.24│ 48.70│
+│ Sum │181.00│147.00│197.00│181.00│180.00│194.00│178.00│177.00│191.00│
+│ Unweighted Count │ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│
+│ Total N │ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│ 10│
+│ Unweighted Layer Row Sum %│ 26.3%│ 21.3%│ .│ 26.3%│ 26.1%│ .│ .│ .│ .│
+╰────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────╯
])
AT_CLEANUP