Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Again some questions about data management (Stata10)


From   "Katia Bobulova" <katia.bobulova@googlemail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Again some questions about data management (Stata10)
Date   Thu, 24 Jul 2008 11:01:19 +0200

Dear all,

I still have some questions about my dataset. Now I have Stata 10.

These are my variables:

timedate         double %tc..
bondcode       str12  %12s
qty                 float  %9.0g
verb               str4   %9s
controlvar       str1   %9s
seqno            int    %8.0g

     +---------------------------------------------------------------------+
       |            timedate       bondcode   verb    qty   contro~r   seqno |
       |---------------------------------------------------------------------|
  337. | 23/02/2007 09:39:47   003        Buy    .15          R       1
  505. | 09/03/2007 08:50:43   004        Buy    .35          R       1
  631. | 23/03/2007 09:22:28   004        Buy    .25          R       1
  913. | 19/04/2007 09:03:04   003        Sell    .25          R       1
 1104. | 05/05/2007 09:10:45   003       Sell    .25          R       1
       |---------------------------------------------------------------------|
 1225. | 14/05/2007 08:56:14   003       Buy     .5          R        1
 1264. | 21/05/2007 08:54:50   003       Sell    .25          R       1
 1380. | 10/06/2007 09:08:41   003       Buy    7.5          R       1
 1411. | 17/06/2007 08:49:10   003       Sell   .708         R       1
 1566. | 22/07/2007 08:59:32   003       Buy      1          R       1
       |---------------------------------------------------------------------|
19948. | 16/02/2007 09:40:50   003      Buy      5           T       1
19977. | 23/02/2007 09:39:47   003      Buy    .15          T       1
20234. | 19/04/2007 09:03:04   003      Sell    .25          T       1
       |---------------------------------------------------------------------|
20451. | 10/06/2007 09:08:41   003      Buy    7.5           T       1
20896. | 10/09/2007 09:11:28   003      Sell     50           T       1
21470. | 30/11/2007 08:41:41   003      Buy      1           T       1
21656. | 07/01/2008 08:56:27   007      Sell     10           T       1
23804. | 04/07/2008 08:35:30   007      Buy      1           T       1
       |---------------------------------------------------------------------|

I would like to drop those observations for which the seqno is the
same, but there is no correspondence for different controlvar.
For example, while I have two observations for 23/02/2007, for
different controlvar, I have only the observation for controlvar T for
16/02/2007, so I would like to drop this observation.

1) Is there a way to instruct Stata to drop all those observations for
which  seqno, bondcode, timedate and verb do not have a corresponding
value both for controlvar R and T?

2) I would like to treat my data as time-series, however the command
does not work, I think because I should do some data transformation
before. Any suggestion?

Thank you very much for your time.

Best,
Katia
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index