Statalist


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

RE: st: : RE: list command


From   "Daniel Sepulveda-Adams" <sepul003@umn.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: : RE: list command
Date   Mon, 4 Aug 2008 12:04:08 -0500

Nick

The number 1 in this sentence represent that Stata will list all ndc that
have more than 1 gpi, included 1; therefore if I change the number by 2 will
be what I want. 

bysort ndc (gpi) : list if gpi[1] != gpi[_N]

Please let me know. Thank you again.

Daniel A. Sepulveda Adams
Research Scientist - PRIME Institute
College of Pharmacy - University of Minnesota
308 Harvard ST SE, Weaver Densford Hall, 7-159
Minneapolis, MN, 55455, USA
Phone: 612-624-8489
Cell Phone: 651-295-7771
Fax: 612-625-9931
Email: sepul003@umn.edu

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: Monday, August 04, 2008 11:00 AM
To: statalist@hsphsun2.harvard.edu
Subject: RE: st: : RE: list command

This to me is not much clearer than it was before. 

It may be that you want to -list- -ndc- for which there are two or more
distinct -gpi-. 

If that is so, -findit distinct-, or 

bysort ndc (gpi) : list if gpi[1] != gpi[_N] 

Nick
n.j.cox@durham.ac.uk 

Daniel Sepulveda-Adams

OK here is an example of what happened in the dataset, this dataset is a
drugs description, therefore codes are associated to names and strength
the
drug and packages size, etc.

Ex:
1) ndc (National Drug Code) assigned one gpi (Generic Product
Identifier)

ndc: 49502007412   gpi: 44100010102005

2) ndc that has more than one gpi (9 in this specific case, why because
each
gpi represent a different packages size)

Ndc: 00904161260  gpi: 44300040007440

Steven Samuels

Daniel, Show us simple examples of data where an observation on  'ndc'
1) does
2) does not

"have two or more gpi".

It seems that by the phrase "two or more gpi" you do NOT mean "gpi = 2"

On Aug 4, 2008, at 11:22 AM, Daniel Sepulveda-Adams wrote:

> I have a question about list command; this is what I'm doing:
>
> list ndc old_ndc e49_ gpi g64_ if gpi>"2"
>
> gpi is a str variable (it is a 14 digit code) & I know is wrong but  
> I can
> not figure it out how I can ask the program give me all ndc that  
> has 2 or
> more gpi.Thanks

*
*   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/

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