data restructure

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

data restructure

Mark Webb-3
I'm struggling with a casestovars data restructure and would appreciate some
assistance from those who use this approach.
 Would like an example of the syntax that would achieve this.

Currently Have.......
Record   Question        Class
1        q1      a
1        q2      b
1        q3      c
1        q4      d
2        q1      e
2        q2      f
2        q3      g
2        q4      h
3        q1      i
3        q2      j
3        q3      k
3        q4      l
Want this format.....
Record   q1      q2      q3      q4
1        a       b       c       d
2        e       f       g       h
3        i       j       k       l

Thanking you
mark

=====================
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: data restructure

Daniel Robertson
Try this:

SORT CASES by Record Question .
CASESTOVARS
 /ID = Record
 /INDEX = Question
 /GROUPBY = VARIABLE .

Your 'Record' variable identifies unique rows in the restructured data
and your 'Question' variable identifies the new variables in the
restructured data.

hope this helps,
Dan R

Mark Webb wrote:

> I'm struggling with a casestovars data restructure and would appreciate some
> assistance from those who use this approach.
>  Would like an example of the syntax that would achieve this.
>
> Currently Have.......
> Record   Question        Class
> 1        q1      a
> 1        q2      b
> 1        q3      c
> 1        q4      d
> 2        q1      e
> 2        q2      f
> 2        q3      g
> 2        q4      h
> 3        q1      i
> 3        q2      j
> 3        q3      k
> 3        q4      l
> Want this format.....
> Record   q1      q2      q3      q4
> 1        a       b       c       d
> 2        e       f       g       h
> 3        i       j       k       l
>
> Thanking you
> mark
>
> =====================
> 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
>
>

--
Daniel Robertson
Senior Research and Planning Associate
Institutional Research and Planning
Cornell University / irp.cornell.edu

=====================
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: data restructure

ViAnn Beadle
In reply to this post by Mark Webb-3
This is pretty simple restructure that you should be able to define via the
Restructure Data wizard.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Mark Webb
Sent: Thursday, January 15, 2009 7:38 AM
To: [hidden email]
Subject: data restructure

I'm struggling with a casestovars data restructure and would appreciate some
assistance from those who use this approach.
 Would like an example of the syntax that would achieve this.

Currently Have.......
Record   Question        Class
1        q1      a
1        q2      b
1        q3      c
1        q4      d
2        q1      e
2        q2      f
2        q3      g
2        q4      h
3        q1      i
3        q2      j
3        q3      k
3        q4      l
Want this format.....
Record   q1      q2      q3      q4
1        a       b       c       d
2        e       f       g       h
3        i       j       k       l

Thanking you
mark

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

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