merging 2 Tables Output

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

merging 2 Tables Output

Arora, Manoj (IMDLR)

Hi All,

 

I have 2 tables below and I want to merge these two tables in single tables like given below

 

 

 

 

DIVISIONSEGMENT

1.00 BRANCH FUNCTIONS

2.00 BUILDING SEGMENT

3.00 CABLE

4.00 CRI

5.00 ECD

6.00 HO FUNCTIONS

7.00 INDUSTRIAL PRODUCT

8.00 LIGHTING

9.00 MANUFACTURING

10.00 SALES COMMON

11.00 STANDARD

gendor

1.00 FEMALE

Column N %

4.9%

0.5%

6.5%

8.8%

1.2%

10.0%

0.0%

1.8%

5.7%

0.0%

0.0%

2.00 MALE

Column N %

95.1%

99.5%

93.5%

91.3%

98.8%

90.0%

100.0%

98.2%

94.3%

100.0%

100.0%

 

 

Comparisons of Column Proportionsb

 

DIVISIONSEGMENT

1.00 BRANCH FUNCTIONS

2.00 BUILDING SEGMENT

3.00 CABLE

4.00 CRI

5.00 ECD

6.00 HO FUNCTIONS

7.00 INDUSTRIAL PRODUCT

8.00 LIGHTING

9.00 MANUFACTURING

10.00 SALES COMMON

11.00 STANDARD

(A)

(B)

(C)

(D)

(E)

(F)

(G)

(H)

(I)

(J)

(K)

gendor

1.00 FEMALE

 

 

 

B

 

B E

.a

 

B

.a

.a

2.00 MALE

 

D F I

 

 

F

 

.a

 

 

.a

.a

Results are based on two-sided tests with significance level .05. For each significant pair, the key of the category with the smaller column proportion appears under the category with the larger column proportion.

a. This category is not used in comparisons because its column proportion is equal to zero or one.

b. Tests are adjusted for all pairwise comparisons within a row of each innermost subtable using the Bonferroni correction.

 

I want to generate new table like this

 

 

DIVISIONSEGMENT

1.00 BRANCH FUNCTIONS

2.00 BUILDING SEGMENT

3.00 CABLE

4.00 CRI

5.00 ECD

6.00 HO FUNCTIONS

7.00 INDUSTRIAL PRODUCT

8.00 LIGHTING

9.00 MANUFACTURING

10.00 SALES COMMON

11.00 STANDARD

gendor

1.00 FEMALE

Column N %

4.9%

.5%

6.5%

8.8%

1.2%

10.0%

0.0%

1.8%

5.7%

0.0%

0.0%

Sig

 

 

 

B

 

B E

.a

 

B

.a

.a

2.00 MALE

Column N %

95.1%

99.5%

93.5%

91.3%

98.8%

90.0%

100.0%

98.2%

94.3%

100.0%

100.0%

 

2.00 MALE

Sig

 

D F I

 

 

F

 

.a

 

 

.a

.a

 

I am using the following syntax but it is not working

 

 

CTABLES

  /VLABELS VARIABLES=gendor div_seg DISPLAY=LABEL

  /TABLE gendor [C][COLPCT.COUNT PCT40.1] BY div_seg [C]

  /SLABELS POSITION=ROW

  /CATEGORIES VARIABLES=gendor div_seg ORDER=A KEY=VALUE EMPTY=INCLUDE

  /COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=BONFERRONI ORIGIN=COLUMN INCLUDEMRSETS=YES

    CATEGORIES=ALLVISIBLE MERGE=NO.

 

SPSSINC MERGE TABLES MATCHLABEL="Column Total N %" ATTACH=ROWS MODE=MERGE

/OPTIONS HIDE=Yes APPENDTITLE=No APPENDCAPTION=Yes ADDLABELLEAF=Yes HALIGN=RIGHT SEPARATOR="\n" .

 

Please help in correcting the same or any Python Utility to get the output in same format.

 

Regards

Manoj

 



Kantar Disclaimer ===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: merging 2 Tables Output

Jon Peck
Looking at your syntax, I see that the label specification in MERGE TABLES does not match the label in the table.  Something like this will work.
CTABLES
  /VLABELS VARIABLES=gender jobcat DISPLAY=DEFAULT
  /TABLE gender [C][COLPCT.COUNT PCT40.1] BY jobcat [C]
  /SLABELS POSITION=ROW
  /CATEGORIES VARIABLES=gender jobcat ORDER=A KEY=VALUE EMPTY=INCLUDE MISSING=EXCLUDE
  /CRITERIA CILEVEL=95
  /COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=BONFERRONI ORIGIN=COLUMN INCLUDEMRSETS=YES 
    CATEGORIES=ALLVISIBLE MERGE=NO SHOWSIG=NO.

SPSSINC MERGE TABLES MATCHLABEL="Column N %" ATTACH=ROWS MODE=MERGE
/OPTIONS HIDE=no APPENDTITLE=No APPENDCAPTION=Yes ADDLABELLEAF=Yes HALIGN=RIGHT SEPARATOR="\n" .

But if you have at least Statistics version 24, you can produce the combined table directly by specifying
  /COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=BONFERRONI ORIGIN=COLUMN INCLUDEMRSETS=YES 
    CATEGORIES=ALLVISIBLE MERGE=YES STYLE=SIMPLE SHOWSIG=NO.

If you do it this way, you can use SPSSINC MODIFY TABLES to highlight significant cells in various ways.

On Tue, Sep 25, 2018 at 11:57 AM Jon Peck <[hidden email]> wrote:
Or, please send me ...

Also, what version of Statistics are you using?

On Tue, Sep 25, 2018 at 7:21 AM Jon Peck <[hidden email]> wrote:
Pulse end me an sav file containing the two tables

On Tue, Sep 25, 2018 at 5:27 AM Arora, Manoj (IMDLR) <[hidden email]> wrote:

Hi All,

 

I have 2 tables below and I want to merge these two tables in single tables like given below

 

 

 

 

DIVISIONSEGMENT

1.00 BRANCH FUNCTIONS

2.00 BUILDING SEGMENT

3.00 CABLE

4.00 CRI

5.00 ECD

6.00 HO FUNCTIONS

7.00 INDUSTRIAL PRODUCT

8.00 LIGHTING

9.00 MANUFACTURING

10.00 SALES COMMON

11.00 STANDARD

gendor

1.00 FEMALE

Column N %

4.9%

0.5%

6.5%

8.8%

1.2%

10.0%

0.0%

1.8%

5.7%

0.0%

0.0%

2.00 MALE

Column N %

95.1%

99.5%

93.5%

91.3%

98.8%

90.0%

100.0%

98.2%

94.3%

100.0%

100.0%

 

 

Comparisons of Column Proportionsb

 

DIVISIONSEGMENT

1.00 BRANCH FUNCTIONS

2.00 BUILDING SEGMENT

3.00 CABLE

4.00 CRI

5.00 ECD

6.00 HO FUNCTIONS

7.00 INDUSTRIAL PRODUCT

8.00 LIGHTING

9.00 MANUFACTURING

10.00 SALES COMMON

11.00 STANDARD

(A)

(B)

(C)

(D)

(E)

(F)

(G)

(H)

(I)

(J)

(K)

gendor

1.00 FEMALE

 

 

 

B

 

B E

.a

 

B

.a

.a

2.00 MALE

 

D F I

 

 

F

 

.a

 

 

.a

.a

Results are based on two-sided tests with significance level .05. For each significant pair, the key of the category with the smaller column proportion appears under the category with the larger column proportion.

a. This category is not used in comparisons because its column proportion is equal to zero or one.

b. Tests are adjusted for all pairwise comparisons within a row of each innermost subtable using the Bonferroni correction.

 

I want to generate new table like this

 

 

DIVISIONSEGMENT

1.00 BRANCH FUNCTIONS

2.00 BUILDING SEGMENT

3.00 CABLE

4.00 CRI

5.00 ECD

6.00 HO FUNCTIONS

7.00 INDUSTRIAL PRODUCT

8.00 LIGHTING

9.00 MANUFACTURING

10.00 SALES COMMON

11.00 STANDARD

gendor

1.00 FEMALE

Column N %

4.9%

.5%

6.5%

8.8%

1.2%

10.0%

0.0%

1.8%

5.7%

0.0%

0.0%

Sig

 

 

 

B

 

B E

.a

 

B

.a

.a

2.00 MALE

Column N %

95.1%

99.5%

93.5%

91.3%

98.8%

90.0%

100.0%

98.2%

94.3%

100.0%

100.0%

 

2.00 MALE

Sig

 

D F I

 

 

F

 

.a

 

 

.a

.a

 

I am using the following syntax but it is not working

 

 

CTABLES

  /VLABELS VARIABLES=gendor div_seg DISPLAY=LABEL

  /TABLE gendor [C][COLPCT.COUNT PCT40.1] BY div_seg [C]

  /SLABELS POSITION=ROW

  /CATEGORIES VARIABLES=gendor div_seg ORDER=A KEY=VALUE EMPTY=INCLUDE

  /COMPARETEST TYPE=PROP ALPHA=0.05 ADJUST=BONFERRONI ORIGIN=COLUMN INCLUDEMRSETS=YES

    CATEGORIES=ALLVISIBLE MERGE=NO.

 

SPSSINC MERGE TABLES MATCHLABEL="Column Total N %" ATTACH=ROWS MODE=MERGE

/OPTIONS HIDE=Yes APPENDTITLE=No APPENDCAPTION=Yes ADDLABELLEAF=Yes HALIGN=RIGHT SEPARATOR="\n" .

 

Please help in correcting the same or any Python Utility to get the output in same format.

 

Regards

Manoj

 



Kantar Disclaimer
===================== 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]

--
Jon K Peck
[hidden email]



--
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