grouping

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

grouping

Moon Kid
I am not sure how I should describe this. ;)

There is a count of specific activies in specific time-phases.
e.g. v23Aa = 7 means measuring the blood pressure(=a) seven times before
0 o'clock(=A). v23Ca = 2 means the same job(=a) done two times after 3
o'clock(=C).
v23Bc = 4 means drinking coffee(=c) four times between 0 and 3
o'clock(=B).

Now I think about how can SPSS help me to display that in a nice way. ;)

The important point is that I don't want to display each job itself. I
need to group them. Lets say I need the mean-value over all
observations displayed in two groups of jobs.
v23Aa+v23Ab is one group and v23Ac+v23Ad is the second group. Switch
the A with B or C for the other two time phases.

Quite complex, ne?! ;)

The nicest thing would be to display the job-groups (row by row) with
its mean-values for all three time-phases (columns) in one table.
But no matter in how many tables this information is displayed I don't
even know how to display it at all.

First of all, how can I group the variables for the job-groups I
described below?

* before 00:00
DESCRIPTIVES VARIABLES=v23Aa v23Ab v23Ac v23Ad
  /STATISTICS=MEAN.

* between 00:00 and 03:00
DESCRIPTIVES VARIABLES=v23Ba v23Bb v23Bc v23Bd
  /STATISTICS=MEAN.

* after 03:00
DESCRIPTIVES VARIABLES=v23Ca v23Cb v23Cc v23Cd
  /STATISTICS=MEAN.

btw: I tried to click a little bit in the gui but found now
Analyse-Item to do my job. Maybe I need to think around a corner I can
not see?

=====================
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: grouping

David Marso
Administrator
I will refrain from writing your code but see VARSTOCASES, RECODE and SUMMARIZE commands!
If you have the TABLES add on module then you can do fancier output variations.

Moon Kid wrote
I am not sure how I should describe this. ;)

There is a count of specific activies in specific time-phases.
e.g. v23Aa = 7 means measuring the blood pressure(=a) seven times before
0 o'clock(=A). v23Ca = 2 means the same job(=a) done two times after 3
o'clock(=C).
v23Bc = 4 means drinking coffee(=c) four times between 0 and 3
o'clock(=B).

Now I think about how can SPSS help me to display that in a nice way. ;)

The important point is that I don't want to display each job itself. I
need to group them. Lets say I need the mean-value over all
observations displayed in two groups of jobs.
v23Aa+v23Ab is one group and v23Ac+v23Ad is the second group. Switch
the A with B or C for the other two time phases.

Quite complex, ne?! ;)

The nicest thing would be to display the job-groups (row by row) with
its mean-values for all three time-phases (columns) in one table.
But no matter in how many tables this information is displayed I don't
even know how to display it at all.

First of all, how can I group the variables for the job-groups I
described below?

* before 00:00
DESCRIPTIVES VARIABLES=v23Aa v23Ab v23Ac v23Ad
  /STATISTICS=MEAN.

* between 00:00 and 03:00
DESCRIPTIVES VARIABLES=v23Ba v23Bb v23Bc v23Bd
  /STATISTICS=MEAN.

* after 03:00
DESCRIPTIVES VARIABLES=v23Ca v23Cb v23Cc v23Cd
  /STATISTICS=MEAN.

btw: I tried to click a little bit in the gui but found now
Analyse-Item to do my job. Maybe I need to think around a corner I can
not see?

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: grouping

Moon Kid
On 2014-04-01 08:44 David Marso <[hidden email]> wrote:
> I will refrain from writing your code but see VARSTOCASES, RECODE and
> SUMMARIZE commands!

I am not sure if I understand VARSTOCASES right. But I think it doesn't
fit for my case. SUMMARIZE looks nice.

But my current (maybe not the last) solution is to just COMPUTE
(SUM()) the groups in new variables. Then I display them with CTABLES
per each ward.

Just pseudocode for example:
COMPUTE v23A.one = SUM(v23Aa TO v23Ab).
COMPUTE v23A.two = SUM(v23Ac TO v23Ad).
COMPUTE v23B.one = ...
COMPUTE v23B.two = ...
COMPUTE v23C.one = ...
COMPUTE v23C.two = ...

CTABLES
  /VLABELS VARIABLES=vWard DISPLAY=NONE /VLABELS VARIABLES=v23A.P
v23A.MDT v23B.P v23B.MDT v23C.P v23C.MDT DISPLAY=LABEL
  /TABLE v01 [C] BY v23A.P [S][MEAN] + v23A.MDT [S][MEAN] + v23B.P
[S][MEAN] + v23B.MDT [S][MEAN] + v23C.P [S][MEAN] + v23C.MDT [S][MEAN]
  /CATEGORIES VARIABLES=v01 ORDER=A KEY=VALUE EMPTY=EXCLUDE.


> If you have the TABLES add on module then you can do fancier output
> variations.

I can not found "TABLES" in the installed or downloadable bundles list.
Can you please specify the name?
--
<http://dontbubble.us/>

=====================
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: grouping

David Marso
Administrator
I actually meant CTABLES.  
Way back in the days when dinosaurs ran amok it was called simply TABLES, these days it goes by the name Custom Tables (CTABLES)
Moon Kid wrote
On 2014-04-01 08:44 David Marso <[hidden email]> wrote:
> I will refrain from writing your code but see VARSTOCASES, RECODE and
> SUMMARIZE commands!

I am not sure if I understand VARSTOCASES right. But I think it doesn't
fit for my case. SUMMARIZE looks nice.

But my current (maybe not the last) solution is to just COMPUTE
(SUM()) the groups in new variables. Then I display them with CTABLES
per each ward.

Just pseudocode for example:
COMPUTE v23A.one = SUM(v23Aa TO v23Ab).
COMPUTE v23A.two = SUM(v23Ac TO v23Ad).
COMPUTE v23B.one = ...
COMPUTE v23B.two = ...
COMPUTE v23C.one = ...
COMPUTE v23C.two = ...

CTABLES
  /VLABELS VARIABLES=vWard DISPLAY=NONE /VLABELS VARIABLES=v23A.P
v23A.MDT v23B.P v23B.MDT v23C.P v23C.MDT DISPLAY=LABEL
  /TABLE v01 [C] BY v23A.P [S][MEAN] + v23A.MDT [S][MEAN] + v23B.P
[S][MEAN] + v23B.MDT [S][MEAN] + v23C.P [S][MEAN] + v23C.MDT [S][MEAN]
  /CATEGORIES VARIABLES=v01 ORDER=A KEY=VALUE EMPTY=EXCLUDE.


> If you have the TABLES add on module then you can do fancier output
> variations.

I can not found "TABLES" in the installed or downloadable bundles list.
Can you please specify the name?
--
<http://dontbubble.us/>

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: grouping

Jon K Peck
Well, it is a completely different procedure with different syntax.  (We still ship a program to (mostly) convert old TABLES syntax to CTABLES).

But, Moon Kid, CTABLES is an optional procedure that you might or might not have.


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




From:        David Marso <[hidden email]>
To:        [hidden email],
Date:        04/02/2014 01:37 PM
Subject:        Re: [SPSSX-L] grouping
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




I actually meant CTABLES.
Way back in the days when dinosaurs ran amok it was called simply TABLES,
these days it goes by the name Custom Tables (CTABLES)

Moon Kid wrote
> On 2014-04-01 08:44 David Marso &lt;

> david.marso@

> &gt; wrote:
>> I will refrain from writing your code but see VARSTOCASES, RECODE and
>> SUMMARIZE commands!
>
> I am not sure if I understand VARSTOCASES right. But I think it doesn't
> fit for my case. SUMMARIZE looks nice.
>
> But my current (maybe not the last) solution is to just COMPUTE
> (SUM()) the groups in new variables. Then I display them with CTABLES
> per each ward.
>
> Just pseudocode for example:
> COMPUTE v23A.one = SUM(v23Aa TO v23Ab).
> COMPUTE v23A.two = SUM(v23Ac TO v23Ad).
> COMPUTE v23B.one = ...
> COMPUTE v23B.two = ...
> COMPUTE v23C.one = ...
> COMPUTE v23C.two = ...
>
> CTABLES
>   /VLABELS VARIABLES=vWard DISPLAY=NONE /VLABELS VARIABLES=v23A.P
> v23A.MDT v23B.P v23B.MDT v23C.P v23C.MDT DISPLAY=LABEL
>   /TABLE v01 [C] BY v23A.P [S][MEAN] + v23A.MDT [S][MEAN] + v23B.P
> [S][MEAN] + v23B.MDT [S][MEAN] + v23C.P [S][MEAN] + v23C.MDT [S][MEAN]
>   /CATEGORIES VARIABLES=v01 ORDER=A KEY=VALUE EMPTY=EXCLUDE.
>
>
>> If you have the TABLES add on module then you can do fancier output
>> variations.
>
> I can not found "TABLES" in the installed or downloadable bundles list.
> Can you please specify the name?
> --
> &lt;
http://dontbubble.us/&gt;
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

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





-----
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/grouping-tp5725153p5725192.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


Reply | Threaded
Open this post in threaded view
|

Re: grouping

Richard Ristow
In reply to this post by Moon Kid
At 11:13 AM 4/1/2014, Moon Kid wrote:

>There is a count of specific activities in specific time-phases.
>e.g. v23Aa = 7 means measuring the blood pressure(=a) seven times
>before 0 o'clock(=A).
>v23Ca = 2 means the same job(=a) done two times after 3 o'clock(=C).
>v23Bc = 4 means drinking coffee(=c) four times between 0 and 3 o'clock(=B).

It appears (though it's not entirely clear) that v23Aa, v23Ca, etc.,
are the names of variables. You have, in effect, data in your
variable names (and, probably, a great many variables); my strong
recommendation is to get it out again (which is where VARSTOCASES comes in):
|-----------------------------|---------------------------|
|Output Created               |02-APR-2014 18:58:55       |
|-----------------------------|---------------------------|
  [TestData]

   ID v23Aa V23Ca V23Bc
1001    7     2     4
  Number of cases read:  1    Number of cases listed:  1


VARSTOCASES
   /MAKE     TimesDone "Number of times job done"
         FROM v23Aa V23Ca V23Bc
   /INDEX  = Job "Code for job and time"(TimesDone)
   /KEEP   =  ID
   /NULL   = KEEP.

Variables to Cases
|-----------------------------|---------------------------|
|Output Created               |02-APR-2014 18:58:55       |
|-----------------------------|---------------------------|
  [TestData]

Generated Variables
|---------|-------------------------------|
|Name     |Label                          |
|---------|-------------------------------|
|Job      |Code for job and time          |
|---------|-------------------------------|
|TimesDone|Number of times job done       |
|---------|-------------------------------|
  Processing Statistics [suppressed]

  STRING  TimeCode JobCode (A1).
VAR LABELS
         TimeCode "Time interval in which job done"
         JobCode  "Job done".

COMPUTE TimeCode = SUBSTR(Job,4,1).
COMPUTE JobCode  = SUBSTR(Job,5,1).

VALUE LABELS JobCode
       "a"  "Take BP"
       "c"  "Drink coffee".
VALUE LABELS TimeCode
       "A"  "..."
       "B"  "...".

LIST.
|-----------------------------|---------------------------|
|Output Created               |02-APR-2014 18:58:55       |
|-----------------------------|---------------------------|
  [TestData]

   ID Job   TimesDone TimeCode JobCode

1001 v23Aa      7    A        a
1001 V23Ca      2    C        a
1001 V23Bc      4    B        c

Number of cases read:  3    Number of cases listed:  3

I think that's a much more tractable form; you can summarize by job,
by time, or any combination. You'll want to assign value labels to
the job and time codes, of course.
=============================
APPENDIX: Test data, and code
(not saved separately)
=============================
DATA LIST LIST
    /ID v23Aa  V23Ca V23Bc
    ( N4, 3F2).
BEGIN DATA
    1001  7     2     4
END DATA.
DATASET NAME TestData.
LIST.

VARSTOCASES
   /MAKE     TimesDone "Number of times job done"
         FROM v23Aa V23Ca V23Bc
   /INDEX  = Job "Code for job and time"(TimesDone)
   /KEEP   =  ID
   /NULL   = KEEP.

LIST.

STRING  TimeCode JobCode (A1).
VAR LABELS
         TimeCode "Time interval in which job done"
         JobCode  "Job done".

COMPUTE TimeCode = SUBSTR(Job,4,1).
COMPUTE JobCode  = SUBSTR(Job,5,1).

VALUE LABELS JobCode
       "a"  "Take BP"
       "c"  "Drink coffee".
VALUE LABELS TimeCode
       "A"  "..."
       "B"  "...".

LIST.

=====================
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: grouping

David Marso
Administrator
Yep, basically what I was hinting at.
My approach these days is make people work a little harder.
Give a person a fish blah blah blah..
---------------------------------
Richard Ristow wrote
At 11:13 AM 4/1/2014, Moon Kid wrote:

>There is a count of specific activities in specific time-phases.
>e.g. v23Aa = 7 means measuring the blood pressure(=a) seven times
>before 0 o'clock(=A).
>v23Ca = 2 means the same job(=a) done two times after 3 o'clock(=C).
>v23Bc = 4 means drinking coffee(=c) four times between 0 and 3 o'clock(=B).

It appears (though it's not entirely clear) that v23Aa, v23Ca, etc.,
are the names of variables. You have, in effect, data in your
variable names (and, probably, a great many variables); my strong
recommendation is to get it out again (which is where VARSTOCASES comes in):
|-----------------------------|---------------------------|
|Output Created               |02-APR-2014 18:58:55       |
|-----------------------------|---------------------------|
  [TestData]

   ID v23Aa V23Ca V23Bc
1001    7     2     4
  Number of cases read:  1    Number of cases listed:  1


VARSTOCASES
   /MAKE     TimesDone "Number of times job done"
         FROM v23Aa V23Ca V23Bc
   /INDEX  = Job "Code for job and time"(TimesDone)
   /KEEP   =  ID
   /NULL   = KEEP.

Variables to Cases
|-----------------------------|---------------------------|
|Output Created               |02-APR-2014 18:58:55       |
|-----------------------------|---------------------------|
  [TestData]

Generated Variables
|---------|-------------------------------|
|Name     |Label                          |
|---------|-------------------------------|
|Job      |Code for job and time          |
|---------|-------------------------------|
|TimesDone|Number of times job done       |
|---------|-------------------------------|
  Processing Statistics [suppressed]

  STRING  TimeCode JobCode (A1).
VAR LABELS
         TimeCode "Time interval in which job done"
         JobCode  "Job done".

COMPUTE TimeCode = SUBSTR(Job,4,1).
COMPUTE JobCode  = SUBSTR(Job,5,1).

VALUE LABELS JobCode
       "a"  "Take BP"
       "c"  "Drink coffee".
VALUE LABELS TimeCode
       "A"  "..."
       "B"  "...".

LIST.
|-----------------------------|---------------------------|
|Output Created               |02-APR-2014 18:58:55       |
|-----------------------------|---------------------------|
  [TestData]

   ID Job   TimesDone TimeCode JobCode

1001 v23Aa      7    A        a
1001 V23Ca      2    C        a
1001 V23Bc      4    B        c

Number of cases read:  3    Number of cases listed:  3

I think that's a much more tractable form; you can summarize by job,
by time, or any combination. You'll want to assign value labels to
the job and time codes, of course.
=============================
APPENDIX: Test data, and code
(not saved separately)
=============================
DATA LIST LIST
    /ID v23Aa  V23Ca V23Bc
    ( N4, 3F2).
BEGIN DATA
    1001  7     2     4
END DATA.
DATASET NAME TestData.
LIST.

VARSTOCASES
   /MAKE     TimesDone "Number of times job done"
         FROM v23Aa V23Ca V23Bc
   /INDEX  = Job "Code for job and time"(TimesDone)
   /KEEP   =  ID
   /NULL   = KEEP.

LIST.

STRING  TimeCode JobCode (A1).
VAR LABELS
         TimeCode "Time interval in which job done"
         JobCode  "Job done".

COMPUTE TimeCode = SUBSTR(Job,4,1).
COMPUTE JobCode  = SUBSTR(Job,5,1).

VALUE LABELS JobCode
       "a"  "Take BP"
       "c"  "Drink coffee".
VALUE LABELS TimeCode
       "A"  "..."
       "B"  "...".

LIST.

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: grouping

Moon Kid
In reply to this post by Richard Ristow
Dear Richard,

big thanks for your detailed explanation of VARSTOCASES. I think I
understand it know how it works. VARSTOCASES is quite powerful. And
for the next time designing a data structure I will remember it.

But In my case I see know advantage in it instead my way.

I just create (COMPUTE) 6 new variables (3 times, each 2 job-groups)
and SUM there all other counting variables fitting in there.
Then I just do a MEAN over each of the 6 variables and list them with
CTABLES depending on another variable (vWard for each line).
Like this...
        JobGroup1 JobGroup2 JobGroup1 JobGroup2 JobGroup1 JobGroup2
        before 0  before 0  0-3       0-3       after 3   after 3
Ward 1   (mean)
Ward 2   (mean)
Ward 3
...


Is it just a doing-the-same-thing-in-more-than-one-way-thing?
When I understand it right, your example is more powerful/flexible when
I want to make more detailed (not only MEAN) analysis depending on
JobGroups and TimeCodes ?

=====================
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: grouping

Richard Ristow
At 05:55 AM 4/3/2014, Moon Kid wrote:

>I just create (COMPUTE) 6 new variables (3 times, each 2 job-groups)
>and SUM there all other counting variables fitting in there.

OK, sounds like that works.

That's a more particular solution; I posted a path to a more general
one. But the choice between particular and general solutions depends
both on personal taste, and on the complexity of the problem. In your
case, having only three time-interval codes simplifies the problem a
lot, and it sounds like you don't have very many job codes, either.

>Then I just do a MEAN over each of the 6 variables and list them
>with CTABLES depending on another variable (Ward) for each line.

Sounds like you're set. Out of curiosity: the mean of each variable
is taken over what set of cases? That is, how is your dataset
actually structured? It's fine if you don't want to bother with this,
as your problem is solved, but I am curious.

>Like this...
>         JobGroup1 JobGroup2 JobGroup1 JobGroup2 JobGroup1 JobGroup2
>         before 0  before 0  0-3       0-3       after 3   after 3
>Ward 1   (mean)
>Ward 2   (mean)
>Ward 3
>
>Is it just a doing-the-same-thing-in-more-than-one-way-thing?

Basically. It sounds like each of your six variables is a sum over a
set of pairs of jobs and time codes; I was looking for a way to do it
where you didn't have to take explicit account of the time codes, in
your summing code. But your approach is just fine.

>When I understand it right, your example is more powerful/flexible
>when I want to make more detailed (not only MEAN) analysis depending
>on JobGroups and TimeCodes ?

Likely, but it'll depend on what analysis you do want, over groups
defined by what criteria.

=====================
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: grouping

Moon Kid
On 2014-04-03 15:18 Richard Ristow <[hidden email]> wrote:
> In your
> case, having only three time-interval codes simplifies the problem a
> lot, and it sounds like you don't have very many job codes, either.

Yes, in the real data structure there are only three time-intervals.
Job codes are from a to w... Must be 27. And all 27 belong to one of
only two job-groups. So I SUM one half of the 27 to JobGroup1 and the
other half to JobGroup2.

> Out of curiosity: the mean of each variable
> is taken over what set of cases? That is, how is your dataset
> actually structured?

I am not sure if I understand your question correct (depending on my
bad english).
With "cases" you mean observations in the dataset or lines/rows in the
table?
There is another variable just telling me on what Ward the observation
was done. I calculate the MEAN over all the observations of each Ward.

=====================
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: grouping

Moon Kid
In reply to this post by Moon Kid
Now I am again in the situation that I don't really know for what
SPSS-Words I should look for. Because it depends on that CTABLES
statement don't open a new thread.

Now I not only need MEAN, I need the 'n' (COUNT), too. But not for each
column-variable, only for the complete row.

See these pseudocode

CTABLES
   /TABLE v01 [C] BY v23.P [S][COUNT MEAN] + v23.MDT [S][COUNT MEAN].

Produce a output like this:

           v23.P      v23.MDT
        Count Mean  Count Mean
Ward 1   0      0    0      0
Ward 2
...

For me it makes no sense to display the same value in one row. I need
it like this.

        Count  v23.P   v23.MDT
                Mean    Mean
Ward 1   0       0        0
Ward 2
...

This is just a simplified example. In the real set there will be some
more variables as only 'v01' in the rows.

Maybe I missunderstood CTABLES? I don't know where to start.

Just to be clear because of my unstatistical vocabular:
"Count" means for me the number of cases/observastions used to
calculate the MEAN of v23.P or v23.MDT.

=====================
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: grouping

Jon K Peck
See below.


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




From:        Moon Kid <[hidden email]>
To:        [hidden email],
Date:        04/03/2014 03:36 PM
Subject:        Re: [SPSSX-L] grouping
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Now I am again in the situation that I don't really know for what
SPSS-Words I should look for. Because it depends on that CTABLES
statement don't open a new thread.

Now I not only need MEAN, I need the 'n' (COUNT), too. But not for each
column-variable, only for the complete row.

See these pseudocode

CTABLES
  /TABLE v01 [C] BY v23.P [S][COUNT MEAN] + v23.MDT [S][COUNT MEAN].

Produce a output like this:

          v23.P      v23.MDT
       Count Mean  Count Mean
Ward 1   0      0    0      0
Ward 2
...

For me it makes no sense to display the same value in one row. I need
it like this.

       Count  v23.P   v23.MDT
               Mean    Mean
Ward 1   0       0        0
Ward 2
...


>>>Bear in mind that if you have any missing data, the counts may differ for different variables.  However, if that is  not an issue, you can request different statistics for the variables in order to avoid redundant columns.
For example,
/table ward by v23.P[count mean] + v23.MDT[mean]

This is just a simplified example. In the real set there will be some
more variables as only 'v01' in the rows.

Maybe I misunderstood CTABLES? I don't know where to start.

Just to be clear because of my unstatistical vocabulary:
"Count" means for me the number of cases/observations used to
calculate the MEAN of v23.P or v23.MDT.

=====================
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: grouping

Moon Kid
On 2014-04-03 16:12 Jon K Peck <[hidden email]> wrote:
> Bear in mind that if you have any missing data, the counts may
> differ for different variables.

Yes, I will.

> However, if that is  not an issue, you can
> request different statistics for the variables in order to avoid
> redundant columns.

What do you mean with "different statistics"? Just two CTABLES
commands? But that would produce more than one table.
I need more (scriptable) control about the layout of the output. It is
something I really miss in SPSS. The in-viewer-editor or the MS Word
export doesn't fix that.

=====================
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: grouping

Jon K Peck
No, I mean one table as I showed in the example with this CTABLES subcommand:
/table ward by v23.P[count mean] + v23.MDT[mean]

CTABLES has a lot of other ways to control the table layout as well.  I suggest that you explore this with Analyze > Tables > Custom Tables.  The drag-and-drop canvas gives you an easy way to experiment with different layouts.




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




From:        Moon Kid <[hidden email]>
To:        [hidden email],
Date:        04/04/2014 01:56 AM
Subject:        Re: [SPSSX-L] grouping
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




On 2014-04-03 16:12 Jon K Peck <[hidden email]> wrote:
> Bear in mind that if you have any missing data, the counts may
> differ for different variables.

Yes, I will.

> However, if that is  not an issue, you can
> request different statistics for the variables in order to avoid
> redundant columns.

What do you mean with "different statistics"? Just two CTABLES
commands? But that would produce more than one table.
I need more (scriptable) control about the layout of the output. It is
something I really miss in SPSS. The in-viewer-editor or the MS Word
export doesn't fix that.

=====================
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: grouping

Moon Kid
On 2014-04-04 06:54 Jon K Peck <[hidden email]> wrote:
> /table ward by v23.P[count mean] + v23.MDT[mean]

This is quite ugly and looks like this

           v23.P      v23.MDT
        Count Mean     Mean
Ward 1   0      0       0
Ward 2

> CTABLES has a lot of other ways to control the table layout as well.

I think not enough. ;)

But ok, I deal with it and choose to display the count of each variable.

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