Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: converting bracketed to continuos values


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: converting bracketed to continuos values
Date   Wed, 2 Oct 2002 11:02:50 +0100

Nahid Tabatabai
> 
> I have an account balance variable with bracketed values 
> for some of the observations. I need to convert those 
> bracket values to continuos values. What is the best way of 
> doing that? What type of regression I can use for this 
> variable? It's the dependent variable.    
> 

I guess this means that you have a variable with non-numeric
characters, presumably [], which Stata will be holding
as a string variable. 

If so, then use -destring- to strip the "[]"

. destring myvar, ignore([]) replace 

or (safer) 

. destring myvar, ignore([]) generate(newvar) 

See on-line help for -destring-. 


Nick 
n.j.cox@durham.ac.uk 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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