SPSSINC MERGE TABLE ATTACH=ROWS

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SPSSINC MERGE TABLE ATTACH=ROWS

emma78
Hi,
does anybody by chance have a small example about how to merge two tables by the command ATTACH=ROWS ?
I can add two identical tables by columns but I don't understand how I can merge them by a specific row.
This is the syntax I use for the columns

SPSSINC MERGE TABLES MATCHLABEL="Anzahl" ATTACH=COLUMNS
MODE=MERGE
/OPTIONS HIDE=YES APPENDTITLE=YES APPENDCAPTION=YES ADDLABELLEAF=YES
HALIGN=RIGHT SEPARATOR=" ".
and these are the tables (doesn't make sense to merge them in this case, just an example;-))


                F1 Geschlecht
                Männlich Weiblich
                Anzahl Anzahl
age 18 bis 29 Jahre 10 13
        30 bis 39 Jahre 6 5
        40 bis 49 Jahre 3 3
        50 bis 59 Jahre 4 7
        älter als 60 Jahre 6 2



                F1 Geschlecht
                Männlich Weiblich
                Anzahl Anzahl
age 18 bis 29 Jahre 10 13
        30 bis 39 Jahre 6 5
        40 bis 49 Jahre 3 3
        50 bis 59 Jahre 4 7
        älter als 60 Jahre 6 2

Can I just add the values for 30 bis 39 Jahre?

Thanks in advance!

Reply | Threaded
Open this post in threaded view
|

Re: SPSSINC MERGE TABLE ATTACH=ROWS

Jon Peck
Here are some examples from my testbed.

GET
  FILE='C:\data\1991 U.S. General Social Survey.sav'.
DATASET name DataSet1.
* Custom Tables.
RECODE educ  (0 thru 11=1) (12 thru 15=2) (16 thru Highest=3).
 CTABLES
  /TABLE educ[c] [COUNT F40.0, ROWPCT.COUNT PCT40.1] BY  race
  /SLABELS POSITION=ROW
  /COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=BONFERRONI ORIGIN=COLUMN INCLUDEMRSETS=YES 
    CATEGORIES=ALLVISIBLE MERGE=NO.
 SPSSINC MERGE TABLES MATCHLABEL="Count" ATTACH=ROWS
MODE=MERGE 
/OPTIONS HIDE=NO APPENDTITLE=NO APPENDCAPTION=NO ADDLABELLEAF=NO
HALIGN=RIGHT SEPARATOR="  - ".

The following commands use a sav file that I will send separately.   I will also send the GSS file used above. The merge commands below are alternatives - not meant to run all of them sequentially.

TEMPORARY.
SELECT IF (s1a>0).
CTABLES
  /FORMAT EMPTY=ZERO MISSING='.' MINCOLWIDTH=0.55 MAXCOLWIDTH=0.55 UNITS=INCHES
  /VLABELS VARIABLES=TOTAL countryBA areaBA sizeBA DISPLAY=DEFAULT
  /TABLE s1a [COUNT F40.0, ROWPCT.TOTALN PCT40.1, COLPCT.COUNT PCT40.1, UCOUNT F40.0, TOTALS[COUNT F40.0, ROWPCT.TOTALN PCT40.1, COLPCT.COUNT PCT40.1, UCOUNT F40.0]]
   BY TOTAL + countryBA + areaBA + sizeBA
  /SLABELS POSITION=ROW VISIBLE=YES
  /CATEGORIES VARIABLES=TOTAL countryBA areaBA sizeBA ORDER=A KEY=VALUE EMPTY=INCLUDE
  /CATEGORIES VARIABLES=s1a ORDER=A KEY=VALUE EMPTY=INCLUDE TOTAL=YES POSITION=AFTER MISSING=EXCLUDE
  /COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=NONE ORIGIN=COLUMN MERGE=NO
  /TITLES
   TITLE= "(s1a) What is your primary functional area?"
   CORNER=  'Count' 'Row%' 'Col%' 'Unwgtd N'.
 
SPSSINC MERGE TABLES MATCHLABEL="Column N %" ATTACH=ROWS 
MODE=MERGE 
/OPTIONS HIDE=YES APPENDTITLE=YES APPENDCAPTION=YES ADDLABELLEAF=YES 
HALIGN=RIGHT SEPARATOR="‎\‏‎\‏n". 

SPSSINC MERGE TABLES MATCHLABEL="Column N %" ATTACH=ROWS 
MODE=MERGE 
/OPTIONS HIDE=YES APPENDTITLE=YES APPENDCAPTION=YES ADDLABELLEAF=YES 
HALIGN=RIGHT SEPARATOR="‎\‏‎\‏n" ADDOPPOSITE=YES. 

SPSSINC MERGE TABLES MATCHLABEL="Column N %" ATTACH=ROWS 
MODE=MERGE 
/OPTIONS HIDE=YES APPENDTITLE=YES APPENDCAPTION=YES ADDLABELLEAF=YES 
HALIGN=RIGHT SEPARATOR=" " ADDOPPOSITE=YES ADJUSTVERTLABELALIGN=NO.

SPSSINC MERGE TABLES MATCHLABEL="Column N %" ATTACH=ROWS 
MODE=MERGE 
/OPTIONS HIDE=YES APPENDTITLE=YES APPENDCAPTION=YES ADDLABELLEAF=YES 
HALIGN=RIGHT SEPARATOR=" " ADDOPPOSITE=YES ADJUSTVERTLABELALIGN=YES.


SPSSINC MERGE TABLES MATCHLABEL="Column N %" ATTACH=ROWS 
MODE=MERGE 
/OPTIONS HIDE=YES APPENDTITLE=YES APPENDCAPTION=YES ADDLABELLEAF=YES 
HALIGN=RIGHT SEPARATOR=" " ADDOPPOSITE=YES.

On Fri, Aug 18, 2017 at 4:52 AM, emma78 <[hidden email]> wrote:
Hi,
does anybody by chance have a small example about how to merge two tables by
the command ATTACH=ROWS ?
I can add two identical tables by columns but I don't understand how I can
merge them by a specific row.
This is the syntax I use for the columns

SPSSINC MERGE TABLES MATCHLABEL="Anzahl" ATTACH=COLUMNS
MODE=MERGE
/OPTIONS HIDE=YES APPENDTITLE=YES APPENDCAPTION=YES ADDLABELLEAF=YES
HALIGN=RIGHT SEPARATOR=" ".
and these are the tables (doesn't make sense to merge them in this case,
just an example;-))


                F1 Geschlecht
                Männlich        Weiblich
                Anzahl  Anzahl
age     18 bis 29 Jahre 10      13
        30 bis 39 Jahre 6       5
        40 bis 49 Jahre 3       3
        50 bis 59 Jahre 4       7
        älter als 60 Jahre      6       2



                F1 Geschlecht
                Männlich        Weiblich
                Anzahl  Anzahl
age     18 bis 29 Jahre 10      13
        30 bis 39 Jahre 6       5
        40 bis 49 Jahre 3       3
        50 bis 59 Jahre 4       7
        älter als 60 Jahre      6       2

Can I just add the values for 30 bis 39 Jahre?

Thanks in advance!





--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/SPSSINC-MERGE-TABLE-ATTACH-ROWS-tp5734705.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD



--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD