Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Data structure - left adjusted - numeric variable


From   Danny <[email protected]>
To   [email protected]
Subject   st: Data structure - left adjusted - numeric variable
Date   Wed, 4 Apr 2012 10:20:48 +1200

Dear all,

I would like to re-structure my panel data which currently sit in the fixed column format (looks like the 1st part of my syntax) to left adjusted format (looks like the 2st part of my syntax).

It would be much appreciated if anyone knows any easy syntax or program can handle it?.

**1st part 
clear
input id f1 f2 f3 f4 f5 f6
 1  . 12 23  .  . 56
 2  . 62  .  .  .  .
 3 881  . 453 34 55  .
 4  . 92  .  .  .  .
 5 . 62  .  .  .  .
 6  .  .  .  .  .  67
 7 91  .  .  .  87  .
 8  .  .  .  66  .  .
 9  .  . 53  .  . 76
 End


**2nd part
clear
input id t1 t2 t3 t4 t5 t6
 1  12 23  56 . . .
 2  62  .  .  .  . .
 3 881 453 34 55  . .
 4  92  .  .  .  . .
 5  62  .  .  .  . .
 6  67 .  .  .  .  .  
 7 91 87  . .  .  .
 8  66  .  . .  .  .  
 9  53  76 .  .  .  .
 End


Danny

Data Analyst 
Health Sponsorship Council 
New Zealand


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index