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

st: RE: AW: list command

From   "Nick Cox" <>
To   <>
Subject   st: RE: AW: list command
Date   Mon, 4 Aug 2008 16:39:33 +0100

This advice needs a supplement. Daniel said he had a 14 digit code. In that case 

gen ... = real() 

will create a variable that is mostly garbage. The usual default is to generate a -float- and that can't hold enough digits precisely to be useful. 

-destring- is smarter, but it pays to pay attention to its -format()- option. 


Jochen Späth

why don't you just destring your string variable with one of the following commands and then re-run your 'list'-command replacing 'gpi' with 'newvar'?

'destring gpi, gen(newvar)'		or

'gen newvar = real(gpi)'

Daniel Sepulveda-Adams

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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index