describe matrix like data

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

describe matrix like data

Moon Kid
I am totaly unaware of the needed word for this problem. So I don't
know what to ask for exactly.

I "just" want to describe data like this.

There are a couple of task done in three different time periodes.
It is represented in the data structure like this:
Task-a/PhaseA: vAa
Task-a/PhaseB: vBa
Task-a/PhaseC: vCa
Task-c/PhaseB: vBc
...

I want to display it like this in only one table.

        PhaseA  PhaseB  PhaseC
Task-a    0       3        1
Task-b   .....
Task-c
...

In data it could be described like this.
        PhaseA    PhaseB     PhaseC
Task-a MEAN(vAa)  MEAN(vBa)  MEAN(vCa)
Task-b MEAN(vAb)  MEAN(vBb)  MEAN(vCb)
Task-c MEAN(vAc)  MEAN(vBc)  MEAN(vCc)
...

But I don't know how. I think CTABLES can not handle this.

=====================
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: describe matrix like data

Andy W
I don't have CTABLES, but it sounds to me if you have a set of dummy variables representing Task & Phase and then have a numeric value of v?? you can either generate the necessary aggregation or use CTABLES with the appropriate nesting structure.

Something like:

CTABLES
  /TABLE Task BY v?? [MEAN] > Phase.

Here is an example using AGGREGATE to make the table in a physical SPSS dataset (and this shows the necessary dummy variable structure I was talking about).

**************************.
INPUT PROGRAM.
LOOP Id = 1 TO 1000.
END CASE.
END LOOP.
END FILE.
END INPUT PROGRAM.
STRING Task Phase (A20).
COMPUTE Task = CONCAT("Task-",CHAR.SUBSTR("abc",TRUNC(RV.UNIFORM(1,4)),1)).
COMPUTE Phase = CONCAT("Phase",CHAR.SUBSTR("ABC",TRUNC(RV.UNIFORM(1,4)),1)).
COMPUTE v = RV.NORMAL(0,1).
EXECUTE.

*Example CTABLES command (my best guess).
CTABLES
  /TABLE Task BY v [MEAN] > Phase.

*Using aggregate to get the table.
DATASET DECLARE TabMeans.
AGGREGATE OUTFILE = 'TabMeans'
  /BREAK = Task Phase
  /v = MEAN(v).
DATASET ACTIVATE TabMeans.
CASESTOVARS /ID = Task /INDEX Phase.
**************************.
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/
Reply | Threaded
Open this post in threaded view
|

Re: describe matrix like data

David Marso
Administrator
In reply to this post by Moon Kid
A specific numeric example might be useful to communicate the actual issue.
In lieu of this I direct you to study the AGGREGATE and CASESTOVARS commands!

Moon Kid wrote
I am totaly unaware of the needed word for this problem. So I don't
know what to ask for exactly.

I "just" want to describe data like this.

There are a couple of task done in three different time periodes.
It is represented in the data structure like this:
Task-a/PhaseA: vAa
Task-a/PhaseB: vBa
Task-a/PhaseC: vCa
Task-c/PhaseB: vBc
...

I want to display it like this in only one table.

        PhaseA  PhaseB  PhaseC
Task-a    0       3        1
Task-b   .....
Task-c
...

In data it could be described like this.
        PhaseA    PhaseB     PhaseC
Task-a MEAN(vAa)  MEAN(vBa)  MEAN(vCa)
Task-b MEAN(vAb)  MEAN(vBb)  MEAN(vCb)
Task-c MEAN(vAc)  MEAN(vBc)  MEAN(vCc)
...

But I don't know how. I think CTABLES can not handle this.

=====================
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: describe matrix like data

Richard Ristow
In reply to this post by Moon Kid
At 12:36 PM 4/22/2014, Moon Kid wrote:

>There are a couple of task done in three different time periodes.
>It is represented in the data structure like this:
>Task-a/PhaseA: vAa
>Task-a/PhaseB: vBa
>Task-a/PhaseC: vCa
>Task-c/PhaseB: vBc
>...
>
>I want to display it like this in only one table.
>In data it could be described like this.
>         PhaseA    PhaseB     PhaseC
>Task-a MEAN(vAa)  MEAN(vBa)  MEAN(vCa)
>Task-b MEAN(vAb)  MEAN(vBb)  MEAN(vCb)
>Task-c MEAN(vAc)  MEAN(vBc)  MEAN(vCc)

This is similar (NOT identical) to a solution I just posted(*). David
is right that it's AGGREGATE followed by CASESTOVARS. Assuming you
start with a file with three variables, namely 'Task', 'Phase', and
'Value', something like this (untested)

DATASET   DECLARE Summary.
AGGREGATE OUTFILE=Summary
    /BREAK= Task Phase
    /MeanVal = MEAN(Value).

CASESTOVARS
    /ID      = Task
    /INDEX   = Phase.


(*) See
Date:    Wed, 23 Apr 2014 17:48:00 -0400
From:    Richard Ristow <[hidden email]>
Subject: Re: Dsiplaying mulitple values
To:      [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
Reply | Threaded
Open this post in threaded view
|

Re: describe matrix like data

David Marso
Administrator
Slip
DATASET ACTIVATE summary.
in between the AGG and C2V.

Richard Ristow wrote
At 12:36 PM 4/22/2014, Moon Kid wrote:

>There are a couple of task done in three different time periodes.
>It is represented in the data structure like this:
>Task-a/PhaseA: vAa
>Task-a/PhaseB: vBa
>Task-a/PhaseC: vCa
>Task-c/PhaseB: vBc
>...
>
>I want to display it like this in only one table.
>In data it could be described like this.
>         PhaseA    PhaseB     PhaseC
>Task-a MEAN(vAa)  MEAN(vBa)  MEAN(vCa)
>Task-b MEAN(vAb)  MEAN(vBb)  MEAN(vCb)
>Task-c MEAN(vAc)  MEAN(vBc)  MEAN(vCc)

This is similar (NOT identical) to a solution I just posted(*). David
is right that it's AGGREGATE followed by CASESTOVARS. Assuming you
start with a file with three variables, namely 'Task', 'Phase', and
'Value', something like this (untested)

DATASET   DECLARE Summary.
AGGREGATE OUTFILE=Summary
    /BREAK= Task Phase
    /MeanVal = MEAN(Value).

CASESTOVARS
    /ID      = Task
    /INDEX   = Phase.


(*) See
Date:    Wed, 23 Apr 2014 17:48:00 -0400
From:    Richard Ristow <[hidden email]>
Subject: Re: Dsiplaying mulitple values
To:      [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
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: describe matrix like data

Richard Ristow
At 07:39 PM 4/23/2014, David Marso wrote:

>Slip
>DATASET ACTIVATE summary.
>in between the AGG and C2V.

Thx.

=====================
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: describe matrix like data

David Marso
Administrator
I've been bitten before by forgetting that non * files do not have 'focus' after AGGREGATE.

Richard Ristow wrote
At 07:39 PM 4/23/2014, David Marso wrote:

>Slip
>DATASET ACTIVATE summary.
>in between the AGG and C2V.

Thx.

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