Restructure data

Restructure data

Post by peterss » Tue, 02 Oct 2001 19:02:57



Hi,

I have a database with an IDnr and some variables (different every
time, so a suggestion that is independent of how many would be nice).
I would like to go from the standard "one IP per row" to as many rows
per IP as there are variables.

How do I get from here:
i v1 v2 v3 v4
=============
1  1  0  1  ,
2  0  0  1  1
3  1  ,  0  1

to here???:
i  v  x
=======
1  1  1
1  2  0
1  3  1
1  4  ,
2  1  0
2  2  0
2  3  1
2  4  1
3  1  1
3  2  ,
3  3  0
3  4  1

TIA
/s

 
 
 

Restructure data

Post by Brendan Halpi » Tue, 02 Oct 2001 21:25:53



> How do I get from here:
> i v1 v2 v3 v4
> =============
> 1  1  0  1  ,
> 2  0  0  1  1
> 3  1  ,  0  1

> to here???:
> i  v  x
> =======
> 1  1  1
> 1  2  0
> 1  3  1
> 1  4  ,
> 2  1  0
> 2  2  0
> 2  3  1
> 2  4  1
> 3  1  1
> 3  2  ,
> 3  3  0
> 3  4  1

Have a look at
<http://wivenhoe.staff8.ul.ie/~brendan/DCW/practicals/node27.html>.

Brendan
--
Brendan Halpin, Dept of Government and Society, Limerick University, Ireland
Tel: w +353-61-213147; f +353-61-202569; h +353-61-390476; Room S1-03 x 3147


 
 
 

1. Restructure data from a .sav file

I have a large dataset (~500 vars) in the form of a system
(.sav) file.  I need to do a major restructuring of the data.
If it were a raw data file I could use an INPUT PROGRAM with
COUNTs and VECTORs and DO IFs and END CASEs.  Is there any
alternative to writing out raw data and reading it in again?
========================================================================

Research Computing Support                        P.O. Box 413
Information and Media Technologies                Milwaukee, WI 53201
University of Wisconsin - Milwaukee               (414)-229-4571

2. modem cable

3. restructuring data

4. comp.std.c++ report for Fri Mar 1 00:05:01 EST 2002

5. data restructuring

6. ipsec vs pptp

7. Data restructuring

8. HA

9. data restructure

10. [Re: data restructure]

11. Restructuring f77 Compiler for Meiko CS-1/CS-2

12. fMSX WWW restructured

13. Looking for References: Tools which support restructuring