Statalist


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

Re: st: RE: testing -duplicates tag-


From   "Eva Poen" <eva.poen@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: testing -duplicates tag-
Date   Wed, 3 Sep 2008 17:45:18 +0100

Adding to Nick's comment, -duplicates list- may be the one for you if
are simply after seeing the list:

. duplicates list headroom trunk if trunk==8 & head==2

Duplicates in terms of headroom trunk

  +-------------------------+
  | obs:   headroom   trunk |
  |-------------------------|
  |    7        2.0       8 |
  |    8        2.0       8 |
  +-------------------------+

Eva

2008/9/3 Nick Cox <n.j.cox@durham.ac.uk>:
> As I understand it, the only thing the -tag- subcommand is designed to
> do is -generate- a new variable with specific properties.
>
> It doesn't -list- or otherwise display what it produces.
>
> Think of what -generate- does. You ask for a new variable. If the syntax
> is correct,
> you will get one. If you want to look at it, you need to follow up with
> some other command.
>
> In your example, following with
>
> . l headroom trunk  dup_admission_id if trunk == 8
>
>     +-----------------------------+
>     | headroom   trunk   dup_ad~d |
>     |-----------------------------|
>  20. |      2.0       8          1 |
>  45. |      1.5       8          0 |
>  57. |      2.0       8          1 |
>  58. |      2.5       8          1 |
>  59. |      2.5       8          1 |
>     +-----------------------------+
>
> will show what -duplicates tag- did for you.
>
> Nick
> n.j.cox@durham.ac.uk
>
> Michael McCulloch
>
> I'm testing -duplicates tag-, and puzzled as to why it won't show the
> two observations where headroom==2.0 and trunk==8.
>
> clear
> sysuse auto
> list foreign headroom trunk if trunk==8
> duplicates tag headroom trunk, generate(dup_admission_id)
*
*   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