Custom Tables Valid Percent Question

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

Custom Tables Valid Percent Question

Mario Giesel

Hello, SPSS friends,
  I've got a tricky question on percentages within custom tables.
Say, we're talking about these data:
 
* ========================================================.
DATA LIST FREE (' ') / bought1 bought2.
BEGIN DATA
1 1
1 0
1 1
1 0
9 1
END DATA.
VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2".
VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received'.
MISSING VALUES bought1 bought2 (9).
MRSETS
  /MDGROUP NAME=$bought CATEGORYLABELS=VARLABELS VARIABLES=bought1 bought2 VALUE=1
  /DISPLAY NAME=[$bought].
CTABLES
  /VLABELS VARIABLES=$bought DISPLAY=DEFAULT
  /TABLE $bought [COUNT F40.0, COLPCT.VALIDN PCT40.1]
  /CATEGORIES VARIABLES=$bought  EMPTY=INCLUDE.
 
* ========================================================.
 
In the table bought1 gets 80% "yes" answers as four out of 5 respondents bought that product.
However, I want to have 100% as all respondents who received this question answered "yes".
So my question is: how can I get the percentages that refer to the respective valid bases of the variables?
I'd like to have a compact multi Response table.
Hope I could make my point clear, looking forward to any ideas.
 
Thanks,
  Mario
 
Mario Giesel
Munich, Germany
Reply | Threaded
Open this post in threaded view
|

Re: Custom Tables Valid Percent Question

John F Hall

Mario

 

Not sure about ctables, but I would normally do something like this using MR in dichotomous mode.

 

DATA LIST FREE (' ') / bought1 bought2.

BEGIN DATA

1 1

1 0

1 1

1 0

9 1

END DATA.

VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2".

VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received'.

MISSING VALUES bought1 bought2 (9).

/* MR in dichotomous mode.

mult resp

    groups bought (bought1 bought2 (1))

    /freq bought.

 

 

Case Summary

 

Cases

Valid

Missing

Total

N

Percent

N

Percent

N

Percent

boughta

5

100.0%

0

0.0%

5

100.0%

a. Dichotomy group tabulated at value 1.

 

 

bought Frequencies

 

Responses

Percent of Cases

N

Percent

boughta

Bought product 1

4

57.1%

80.0%

Bought product 2

3

42.9%

60.0%

Total

7

100.0%

140.0%

a. Dichotomy group tabulated at value 1.

 

Does that help at all?

 

 

John F Hall (Mr)

[Retired academic survey researcher]

 

Email:   [hidden email] 

Website: www.surveyresearch.weebly.com

SPSS start page:  www.surveyresearch.weebly.com/spss-without-tears.html

  

  

 

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mario Giesel
Sent: 30 October 2013 17:03
To: [hidden email]
Subject: Custom Tables Valid Percent Question

 

 

Hello, SPSS friends,

  I've got a tricky question on percentages within custom tables.

Say, we're talking about these data:

 

* ========================================================.

DATA LIST FREE (' ') / bought1 bought2.
BEGIN DATA
1 1
1 0
1 1
1 0
9 1
END DATA.
VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2".
VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received'.
MISSING VALUES bought1 bought2 (9).

MRSETS
  /MDGROUP NAME=$bought CATEGORYLABELS=VARLABELS VARIABLES=bought1 bought2 VALUE=1
  /DISPLAY NAME=[$bought].
CTABLES
  /VLABELS VARIABLES=$bought DISPLAY=DEFAULT
  /TABLE $bought [COUNT F40.0, COLPCT.VALIDN PCT40.1]
  /CATEGORIES VARIABLES=$bought  EMPTY=INCLUDE.

 

* ========================================================.

 

In the table bought1 gets 80% "yes" answers as four out of 5 respondents bought that product.

However, I want to have 100% as all respondents who received this question answered "yes".

So my question is: how can I get the percentages that refer to the respective valid bases of the variables?

I'd like to have a compact multi Response table.

Hope I could make my point clear, looking forward to any ideas.

 

Thanks,

  Mario

 

Reply | Threaded
Open this post in threaded view
|

Re: Custom Tables Valid Percent Question

Jon K Peck
In reply to this post by Mario Giesel
It seems like you don't actually want mult response statistics here.  Does this work for you?

CTABLES  /TABLE (bought1 [C] + bought2 [C])[COUNT ROWPCT.COUNT PCT40.1]
  /CLABELS ROWLABELS=OPPOSITE.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Mario Giesel <[hidden email]>
To:        [hidden email],
Date:        10/30/2013 10:04 AM
Subject:        [SPSSX-L] Custom Tables Valid Percent Question
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Hello, SPSS friends,
  I've got a tricky question on percentages within custom tables.
Say, we're talking about these data:
 
* ========================================================.
DATA LIST FREE (' ') / bought1 bought2.
BEGIN DATA
1 1
1 0
1 1
1 0
9 1
END DATA.
VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2".
VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received'.
MISSING VALUES bought1 bought2 (9).

MRSETS
 /MDGROUP NAME=$bought CATEGORYLABELS=VARLABELS VARIABLES=bought1 bought2 VALUE=1
 /DISPLAY NAME=[$bought].
CTABLES
 /VLABELS VARIABLES=$bought DISPLAY=DEFAULT
 /TABLE $bought [COUNT F40.0, COLPCT.VALIDN PCT40.1]
 /CATEGORIES VARIABLES=$bought  EMPTY=INCLUDE.

 
* ========================================================.
 
In the table bought1 gets 80% "yes" answers as four out of 5 respondents bought that product.
However, I want to have 100% as all respondents who received this question answered "yes".
So my question is: how can I get the percentages that refer to the respective valid bases of the variables?
I'd like to have a compact multi Response table.
Hope I could make my point clear, looking forward to any ideas.
 
Thanks,
  Mario
 
Reply | Threaded
Open this post in threaded view
|

Re: Custom Tables Valid Percent Question

Mario Giesel
Thanks to Taras and Jon who suggested a good solution which I shall work with.
Also thanks to John (Hall), although this did not produce my intended solution.

The point why I tried Multiple Response Sets was I didn't like the "no" category in the table as it is somewhat redundant information. But I can live with the less compact solution.

So thanks again and good luck!
  Mario


Jon K Peck <[hidden email]> schrieb am 18:26 Mittwoch, 30.Oktober 2013:
It seems like you don't actually want mult response statistics here.  Does this work for you?

CTABLES  /TABLE (bought1 [C] + bought2 [C])[COUNT ROWPCT.COUNT PCT40.1]
  /CLABELS ROWLABELS=OPPOSITE.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Mario Giesel <[hidden email]>
To:        [hidden email],
Date:        10/30/2013 10:04 AM
Subject:        [SPSSX-L] Custom Tables Valid Percent Question
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Hello, SPSS friends,
  I've got a tricky question on percentages within custom tables.
Say, we're talking about these data:
 
* ========================================================.
DATA LIST FREE (' ') / bought1 bought2.
BEGIN DATA
1 1
1 0
1 1
1 0
9 1
END DATA.
VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2".
VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received'.
MISSING VALUES bought1 bought2 (9).

MRSETS
 /MDGROUP NAME=$bought CATEGORYLABELS=VARLABELS VARIABLES=bought1 bought2 VALUE=1
 /DISPLAY NAME=[$bought].
CTABLES
 /VLABELS VARIABLES=$bought DISPLAY=DEFAULT
 /TABLE $bought [COUNT F40.0, COLPCT.VALIDN PCT40.1]
 /CATEGORIES VARIABLES=$bought  EMPTY=INCLUDE.

 
* ========================================================.
 
In the table bought1 gets 80% "yes" answers as four out of 5 respondents bought that product.
However, I want to have 100% as all respondents who received this question answered "yes".
So my question is: how can I get the percentages that refer to the respective valid bases of the variables?
I'd like to have a compact multi Response table.
Hope I could make my point clear, looking forward to any ideas.
 
Thanks,
  Mario
 


Mario Giesel
Munich, Germany
Reply | Threaded
Open this post in threaded view
|

Re: Custom Tables Valid Percent Question

Jon K Peck
If you want to remove the "no" category from the table, you can hide those columns using the new OUTPUT MODIFY command in V22 or using the SPSSINC MODIFY TABLES in V22 and older versions.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Mario Giesel <[hidden email]>
To:        [hidden email],
Date:        10/31/2013 01:48 AM
Subject:        Re: [SPSSX-L] Custom Tables Valid Percent Question
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Thanks to Taras and Jon who suggested a good solution which I shall work with.
Also thanks to John (Hall), although this did not produce my intended solution.

The point why I tried Multiple Response Sets was I didn't like the "no" category in the table as it is somewhat redundant information. But I can live with the less compact solution.

So thanks again and good luck!
 Mario



Jon K Peck <[hidden email]> schrieb am 18:26 Mittwoch, 30.Oktober 2013:
It seems like you don't actually want mult response statistics here.  Does this work for you?

CTABLES  /TABLE (bought1 [C] + bought2 [C])[COUNT ROWPCT.COUNT PCT40.1]

 /CLABELS ROWLABELS=OPPOSITE.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621





From:        
Mario Giesel <[hidden email]>
To:        
[hidden email],
Date:        
10/30/2013 10:04 AM
Subject:        
[SPSSX-L] Custom Tables Valid Percent Question
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>





Hello, SPSS friends,

 I've got a tricky question on percentages within custom tables.

Say, we're talking about these data:

 
* ========================================================.

DATA LIST FREE (' ') / bought1 bought2.
BEGIN DATA
1 1
1 0
1 1
1 0
9 1
END DATA.
VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2".
VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received'.
MISSING VALUES bought1 bought2 (9).

MRSETS
/MDGROUP NAME=$bought CATEGORYLABELS=VARLABELS VARIABLES=bought1 bought2 VALUE=1
/DISPLAY NAME=[$bought].
CTABLES
/VLABELS VARIABLES=$bought DISPLAY=DEFAULT
/TABLE $bought [COUNT F40.0, COLPCT.VALIDN PCT40.1]
/CATEGORIES VARIABLES=$bought  EMPTY=INCLUDE.

 
* ========================================================.

 
In the table bought1 gets 80% "yes" answers as four out of 5 respondents bought that product.
However, I want to have 100% as all respondents who received this question answered "yes".

So my question is: how can I get the percentages that refer to the respective valid bases of the variables?

I'd like to have a compact multi Response table.

Hope I could make my point clear, looking forward to any ideas.

 
Thanks,

 Mario

 


Reply | Threaded
Open this post in threaded view
|

Re: Custom Tables Valid Percent Question

Mario Giesel
This SPSSINC MODIFY TABLES looks interesting, Jon.
Is there a complete documentation of the functionality? I've got V21.
 
Thanks,
  Mario


Jon K Peck <[hidden email]> schrieb am 13:39 Donnerstag, 31.Oktober 2013:
If you want to remove the "no" category from the table, you can hide those columns using the new OUTPUT MODIFY command in V22 or using the SPSSINC MODIFY TABLES in V22 and older versions.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Mario Giesel <[hidden email]>
To:        [hidden email],
Date:        10/31/2013 01:48 AM
Subject:        Re: [SPSSX-L] Custom Tables Valid Percent Question
Sent by:        "SPSSX(r) Discussion" <[hidden email]>



Thanks to Taras and Jon who suggested a good solution which I shall work with.
Also thanks to John (Hall), although this did not produce my intended solution.

The point why I tried Multiple Response Sets was I didn't like the "no" category in the table as it is somewhat redundant information. But I can live with the less compact solution.

So thanks again and good luck!
 Mario



Jon K Peck <[hidden email]> schrieb am 18:26 Mittwoch, 30.Oktober 2013:
It seems like you don't actually want mult response statistics here.  Does this work for you?

CTABLES  /TABLE (bought1 [C] + bought2 [C])[COUNT ROWPCT.COUNT PCT40.1]

 /CLABELS ROWLABELS=OPPOSITE.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621





From:        
Mario Giesel <[hidden email]>
To:        
[hidden email],
Date:        
10/30/2013 10:04 AM
Subject:        
[SPSSX-L] Custom Tables Valid Percent Question
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>




Hello, SPSS friends,

 I've got a tricky question on percentages within custom tables.

Say, we're talking about these data:

 
* ========================================================.

DATA LIST FREE (' ') / bought1 bought2.
BEGIN DATA
1 1
1 0
1 1
1 0
9 1
END DATA.
VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2".
VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received'.
MISSING VALUES bought1 bought2 (9).

MRSETS
/MDGROUP NAME=$bought CATEGORYLABELS=VARLABELS VARIABLES=bought1 bought2 VALUE=1
/DISPLAY NAME=[$bought].
CTABLES
/VLABELS VARIABLES=$bought DISPLAY=DEFAULT
/TABLE $bought [COUNT F40.0, COLPCT.VALIDN PCT40.1]
/CATEGORIES VARIABLES=$bought  EMPTY=INCLUDE.

 
* ========================================================.

 
In the table bought1 gets 80% "yes" answers as four out of 5 respondents bought that product.
However, I want to have 100% as all respondents who received this question answered "yes".

So my question is: how can I get the percentages that refer to the respective valid bases of the variables?

I'd like to have a compact multi Response table.

Hope I could make my point clear, looking forward to any ideas.

 
Thanks,

 Mario

 




Mario Giesel
Munich, Germany
Reply | Threaded
Open this post in threaded view
|

Re: Custom Tables Valid Percent Question

Jon K Peck
If you install the Python Essentials for V21, SPSSINC MODIFY TABLES is included.  Use the Help button on Utilities > Modify Table Appearance for documentation.  More detailed doc is available from its syntax help (SPSSINC MODIFY TABLES /HELP).  Beyond that, the command supports custom plug-in functions written in Python.  The material includes a bunch of custom functions and documentation for the custom function interface in the customstylefunctions.py module that is installed along with the command.  There are about 35 custom functions in that module that include thing like pivoting, color coding and format changes, and some table-type specific modifications.

In V22, the native OUTPUT MODIFY command, which was developed based on functionality in SPSSINC MODIFY TABLES and SPSSINC MODIFY OUTPUT, provides an easier to use and more integrated capability, but it is not as general as what these extension commands can do.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Mario Giesel <[hidden email]>
To:        Jon K Peck/Chicago/IBM@IBMUS,
Cc:        "[hidden email]" <[hidden email]>
Date:        11/01/2013 08:34 AM
Subject:        Re: [SPSSX-L] Custom Tables Valid Percent Question




This SPSSINC MODIFY TABLES looks interesting, Jon.
Is there a complete documentation of the functionality? I've got V21.
 
Thanks,
  Mario


Jon K Peck <[hidden email]> schrieb am 13:39 Donnerstag, 31.Oktober 2013:
If you want to remove the "no" category from the table, you can hide those columns using the new OUTPUT MODIFY command in V22 or using the SPSSINC MODIFY TABLES in V22 and older versions.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621





From:        
Mario Giesel <[hidden email]>
To:        
[hidden email],
Date:        
10/31/2013 01:48 AM
Subject:        
Re: [SPSSX-L] Custom Tables Valid Percent Question
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>



Thanks to Taras and Jon who suggested a good solution which I shall work with.
Also thanks to John (Hall), although this did not produce my intended solution.

The point why I tried Multiple Response Sets was I didn't like the "no" category in the table as it is somewhat redundant information. But I can live with the less compact solution.

So thanks again and good luck!
Mario



Jon K Peck <[hidden email]> schrieb am 18:26 Mittwoch, 30.Oktober 2013:

It seems like you don't actually want mult response statistics here.  Does this work for you?


CTABLES  /TABLE (bought1 [C] + bought2 [C])[COUNT ROWPCT.COUNT PCT40.1]

/CLABELS ROWLABELS=OPPOSITE.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621





From:        
Mario Giesel <[hidden email]>
To:        
[hidden email],
Date:        
10/30/2013 10:04 AM
Subject:        
[SPSSX-L] Custom Tables Valid Percent Question
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>




Hello, SPSS friends,

I've got a tricky question on percentages within custom tables.

Say, we're talking about these data:


* ========================================================.

DATA LIST FREE (' ') / bought1 bought2.
BEGIN DATA
1 1
1 0
1 1
1 0
9 1
END DATA.
VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2".
VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received'.
MISSING VALUES bought1 bought2 (9).

MRSETS
/MDGROUP NAME=$bought CATEGORYLABELS=VARLABELS VARIABLES=bought1 bought2 VALUE=1
/DISPLAY NAME=[$bought].
CTABLES
/VLABELS VARIABLES=$bought DISPLAY=DEFAULT
/TABLE $bought [COUNT F40.0, COLPCT.VALIDN PCT40.1]
/CATEGORIES VARIABLES=$bought  EMPTY=INCLUDE.


* ========================================================.


In the table bought1 gets 80% "yes" answers as four out of 5 respondents bought that product.
However, I want to have 100% as all respondents who received this question answered "yes".

So my question is: how can I get the percentages that refer to the respective valid bases of the variables?

I'd like to have a compact multi Response table.

Hope I could make my point clear, looking forward to any ideas.


Thanks,

Mario

 




Reply | Threaded
Open this post in threaded view
|

Re: Custom Tables Valid Percent Question

Mario Giesel
Okay, Jon - thanks a lot :-)
 
  Mario


Jon K Peck <[hidden email]> schrieb am 15:57 Freitag, 1.November 2013:
If you install the Python Essentials for V21, SPSSINC MODIFY TABLES is included.  Use the Help button on Utilities > Modify Table Appearance for documentation.  More detailed doc is available from its syntax help (SPSSINC MODIFY TABLES /HELP).  Beyond that, the command supports custom plug-in functions written in Python.  The material includes a bunch of custom functions and documentation for the custom function interface in the customstylefunctions.py module that is installed along with the command.  There are about 35 custom functions in that module that include thing like pivoting, color coding and format changes, and some table-type specific modifications.

In V22, the native OUTPUT MODIFY command, which was developed based on functionality in SPSSINC MODIFY TABLES and SPSSINC MODIFY OUTPUT, provides an easier to use and more integrated capability, but it is not as general as what these extension commands can do.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Mario Giesel <[hidden email]>
To:        Jon K Peck/Chicago/IBM@IBMUS,
Cc:        "[hidden email]" <[hidden email]>
Date:        11/01/2013 08:34 AM
Subject:        Re: [SPSSX-L] Custom Tables Valid Percent Question



This SPSSINC MODIFY TABLES looks interesting, Jon.
Is there a complete documentation of the functionality? I've got V21.
 
Thanks,
  Mario


Jon K Peck <[hidden email]> schrieb am 13:39 Donnerstag, 31.Oktober 2013:
If you want to remove the "no" category from the table, you can hide those columns using the new OUTPUT MODIFY command in V22 or using the SPSSINC MODIFY TABLES in V22 and older versions.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621





From:        
Mario Giesel <[hidden email]>
To:        
[hidden email],
Date:        
10/31/2013 01:48 AM
Subject:        
Re: [SPSSX-L] Custom Tables Valid Percent Question
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>



Thanks to Taras and Jon who suggested a good solution which I shall work with.
Also thanks to John (Hall), although this did not produce my intended solution.

The point why I tried Multiple Response Sets was I didn't like the "no" category in the table as it is somewhat redundant information. But I can live with the less compact solution.

So thanks again and good luck!
Mario



Jon K Peck <[hidden email]> schrieb am 18:26 Mittwoch, 30.Oktober 2013:

It seems like you don't actually want mult response statistics here.  Does this work for you?


CTABLES  /TABLE (bought1 [C] + bought2 [C])[COUNT ROWPCT.COUNT PCT40.1]

/CLABELS ROWLABELS=OPPOSITE.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621





From:        
Mario Giesel <[hidden email]>
To:        
[hidden email],
Date:        
10/30/2013 10:04 AM
Subject:        
[SPSSX-L] Custom Tables Valid Percent Question
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>




Hello, SPSS friends,

I've got a tricky question on percentages within custom tables.

Say, we're talking about these data:


* ========================================================.

DATA LIST FREE (' ') / bought1 bought2.
BEGIN DATA
1 1
1 0
1 1
1 0
9 1
END DATA.
VARIABLE LABELS bought1 "Bought product 1" / bought2 "Bought product 2".
VALUE LABELS bought1 bought2 0 'No' 1 'Yes' 9 'Question not received'.
MISSING VALUES bought1 bought2 (9).

MRSETS
/MDGROUP NAME=$bought CATEGORYLABELS=VARLABELS VARIABLES=bought1 bought2 VALUE=1
/DISPLAY NAME=[$bought].
CTABLES
/VLABELS VARIABLES=$bought DISPLAY=DEFAULT
/TABLE $bought [COUNT F40.0, COLPCT.VALIDN PCT40.1]
/CATEGORIES VARIABLES=$bought  EMPTY=INCLUDE.


* ========================================================.


In the table bought1 gets 80% "yes" answers as four out of 5 respondents bought that product.
However, I want to have 100% as all respondents who received this question answered "yes".

So my question is: how can I get the percentages that refer to the respective valid bases of the variables?

I'd like to have a compact multi Response table.

Hope I could make my point clear, looking forward to any ideas.


Thanks,

Mario

 






Mario Giesel
Munich, Germany