For CROSSTABS, does this give what you want?
/TABLES=var BY month BY year
To generate this via the GUI, let Row=var, Col=month and Layer=year.
progster wrote
Dear all,
I would like to analyze a trend of a variable by month and year, that is create a unique table with both 2013 and 2014 data ant the break for each month (as an Excel pivot table would do).
I tried with both cross table and custom table, but I can only obtain separate tables (only for months or for years).
Thanks in advance for every suggestion.
DATA LIST LIST
/ month year var .
BEGIN DATA.
1 2013 1
2 2013 4
3 2013 5
4 2013 6
5 2013 3
6 2013 4
7 2013 6
8 2013 7
9 2013 4
10 2013 2
11 2013 1
12 2013 5
1 2014 6
2 2014 7
3 2014 4
4 2014 3
5 2014 2
6 2014 2
7 2014 3
8 2014 3
9 2014 2
10 2014 3
END DATA.
LIST.
CROSSTABS
/TABLES=var BY year month
/FORMAT=AVALUE TABLES
/CELLS=COUNT
/COUNT ROUND CELL.
* Custom Tables.
CTABLES
/VLABELS VARIABLES=var year month DISPLAY=LABEL
/TABLE var BY year [COUNT F40.0] > month
/CATEGORIES VARIABLES=var month ORDER=A KEY=VALUE EMPTY=EXCLUDE.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/"When all else fails, RTFM."
PLEASE NOTE THE FOLLOWING:
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (
https://listserv.uga.edu/).