Hi All, With using Pcompute Command in CTABLES I am getting the following type of table
Using below syntax. In base column it is showing 100% instead of Base 38 CTABLES /VLABELS VARIABLES=nQ5a Company DISPLAY=LABEL /PCOMPUTE &cat1 = EXPR([1] + [2] + [3] + [4] + [5]) /PPROPERTIES &cat1 LABEL = "Base" FORMAT=ROWPCT.COUNT PCT40.1 HIDESOURCECATS=NO /TABLE nQ5a [C][ROWPCT.COUNT PCT40.1] BY Company [C] /SLABELS POSITION=ROW /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=nQ5a [1, 2, 3, 4, 5, &cat1, OTHERNM] EMPTY=INCLUDE /CATEGORIES VARIABLES=Company ORDER=A KEY=VALUE EMPTY=INCLUDE. I want a change in the format like
If it is possible, please help. Thanks & 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 |
You can specify a different statistic for a total than for the cells being totalledwithout needing to use a PCOMPUTE. For example, /TABLE x[C][COLPCT.COUNT PCT40.1, TOTALS[COUNT F40.0]] BY y[C] On Fri, Jan 19, 2018 at 5:26 AM, Arora, Manoj (IMDLR) <[hidden email]> wrote:
|
Thanks Jon, But I want the output with Top-2, Bot-2 & Mean also, that is the reason I used PCOMPUTE. I want the output format as follow
Regards Manoj From: Jon Peck [mailto:[hidden email]]
You can specify a different statistic for a total than for the cells being totalledwithout needing to use a PCOMPUTE. For example, /TABLE x[C][COLPCT.COUNT PCT40.1, TOTALS[COUNT F40.0]] BY y[C] On Fri, Jan 19, 2018 at 5:26 AM, Arora, Manoj (IMDLR) <[hidden email]> wrote:
-- Jon K Peck |
In reply to this post by Jon Peck
Hi Jon, With the help of following syntax CTABLES /VLABELS VARIABLES=nQ5a Company DISPLAY=LABEL /PCOMPUTE &cat1 = EXPR([1]*0 + [2]*0 + [3]*0 + [4]*1 + [5]*1) /PPROPERTIES &cat1 LABEL = "Top-2" FORMAT=ROWPCT.COUNT F40.0 HIDESOURCECATS=NO /PCOMPUTE &cat2 = EXPR([1]*1 + [2]*1 + [3]*0 + [4]*0 + [5]*0) /PPROPERTIES &cat2 LABEL = "Bot-2" FORMAT=ROWPCT.COUNT F40.0 HIDESOURCECATS=NO /PCOMPUTE &cat3 = EXPR(([1]*1 + [2]*2 + [3]*3 + [4]*4 + [5]*5) / ([1] + [2] + [3] + [4] + [5])) /PPROPERTIES &cat3 LABEL = "Mean" FORMAT=ROWPCT.COUNT F40.2 HIDESOURCECATS=NO /PCOMPUTE &cat4 = EXPR(([1]*1 + [2]*1 + [3]*1 + [4]*1 + [5]*1)) /PPROPERTIES &cat4 LABEL = "Base" FORMAT=COUNT F40.0 HIDESOURCECATS=NO /TABLE nQ5a [C][ROWPCT.COUNT F40.0, TOTALS[COUNT F40.0]] BY Company [C] /SLABELS POSITION=ROW VISIBLE=NO /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=nQ5a [1, 2, 3, 4, 5, &cat1, &cat2, &cat3, OTHERNM] EMPTY=INCLUDE TOTAL=YES LABEL='Base' POSITION=BEFORE /CATEGORIES VARIABLES=Company ORDER=A KEY=VALUE EMPTY=INCLUDE. I am getting the following output .
When I exported this file in excel, the output was coming in 2 rows. But I want the same in single
row. If I use the following syntax the output come like CTABLES /VLABELS VARIABLES=nQ5a Company DISPLAY=LABEL /PCOMPUTE &cat1 = EXPR([1]*0 + [2]*0 + [3]*0 + [4]*1 + [5]*1) /PPROPERTIES &cat1 LABEL = "Top-2" FORMAT=ROWPCT.COUNT F40.0 HIDESOURCECATS=NO /PCOMPUTE &cat2 = EXPR([1]*1 + [2]*1 + [3]*0 + [4]*0 + [5]*0) /PPROPERTIES &cat2 LABEL = "Bot-2" FORMAT=ROWPCT.COUNT F40.0 HIDESOURCECATS=NO /PCOMPUTE &cat3 = EXPR(([1]*1 + [2]*2 + [3]*3 + [4]*4 + [5]*5) / ([1] + [2] + [3] + [4] + [5])) /PPROPERTIES &cat3 LABEL = "Mean" FORMAT=ROWPCT.COUNT F40.2 HIDESOURCECATS=NO /PCOMPUTE &cat4 = EXPR(([1]*1 + [2]*1 + [3]*1 + [4]*1 + [5]*1)) /PPROPERTIES &cat4 LABEL = "Base" FORMAT=COUNT F40.0 HIDESOURCECATS=NO /TABLE nQ5a [C][ROWPCT.COUNT F40.0, TOTALS[COUNT F40.0]] BY Company [C] /SLABELS POSITION=ROW VISIBLE=NO /CLABELS ROWLABELS=OPPOSITE /CATEGORIES VARIABLES=nQ5a [&cat4, 1, 2, 3, 4, 5, &cat1, &cat2, &cat3, OTHERNM] EMPTY=INCLUDE
TOTAL=YES LABEL='Base' POSITION=BEFORE /CATEGORIES VARIABLES=Company ORDER=A KEY=VALUE EMPTY=INCLUDE.
When we export the same in excel it show the decimal values. Is there any way the output should
be exported without decimal values? Regards Manoj From: Jon Peck [mailto:[hidden email]]
You can specify a different statistic for a total than for the cells being totalledwithout needing to use a PCOMPUTE. For example, /TABLE x[C][COLPCT.COUNT PCT40.1, TOTALS[COUNT F40.0]] BY y[C] On Fri, Jan 19, 2018 at 5:26 AM, Arora, Manoj (IMDLR) <[hidden email]> wrote:
-- Jon K Peck |
In reply to this post by Jon Peck
As far as I know PCOMPUTE only works in table rows, right? Mario Giesel Munich, Germany Jon Peck <[hidden email]> schrieb am 18:43 Freitag, 19.Januar 2018: You can specify a different statistic for a total than for the cells being totalledwithout needing to use a PCOMPUTE. For example, /TABLE x[C][COLPCT.COUNT PCT40.1, TOTALS[COUNT F40.0]] BY y[C] On Fri, Jan 19, 2018 at 5:26 AM, Arora, Manoj (IMDLR) <[hidden email]> wrote:
|
As far as I know PCOMPUTE only works in table rows, right? Mario Giesel Munich, Germany Jon Peck <[hidden email]> schrieb am 18:43 Freitag, 19.Januar 2018: You can specify a different statistic for a total than for the cells being totalledwithout needing to use a PCOMPUTE. For example, /TABLE x[C][COLPCT.COUNT PCT40.1, TOTALS[COUNT F40.0]] BY y[C] On Fri, Jan 19, 2018 at 5:26 AM, Arora, Manoj (IMDLR) <[hidden email]> wrote:
|
PCOMPUTE defines pseudocategories, so it works in any dimension but only within the categories of a single variable in a custom table (CTABLE). The STATS TABLE CALC extension command works on rows or columns of a table including across variable boundaries. It works on almost any table type. On Mon, Jan 22, 2018 at 2:22 PM Mario Giesel <[hidden email]> wrote:
-- |
As the code is, it needs to indicate where the top-2 and bot-2 are located,
and wondering if this codes need to be 'generalized' for multiple tables where the top and bottom values shift. I can't see the utility of this code if this is only for one table. -- Sent from: http://spssx-discussion.1045642.n5.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 |
Free forum by Nabble | Edit this page |