Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: cleaning height data


From   "Radwin, David" <[email protected]>
To   <[email protected]>
Subject   st: RE: cleaning height data
Date   Fri, 14 Feb 2014 16:37:42 -0500

Try compound quotation marks:

. split height, p(`"""')

David
--
David Radwin, Senior Research Associate
Education and Workforce Development
RTI International
2150 Shattuck Ave. Suite 800, Berkeley, CA 94704
Phone: 510-665-8274

www.rti.org/education


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Kathleen L. Carluzzo
> Sent: Friday, February 14, 2014 1:22 PM
> To: [email protected]
> Subject: st: cleaning height data
> 
> Hello, I am trying to clean height data that looks like this:
> 
> height
> 5' 5"
> 5' 0.5"[PT S
> 5' 5"[verb
> 5' 2"
> 6' 0.5"[stat
> 
> I want to convert height to inches; using the "split" command, I can split
> the variable at feet using the single quotation but can't split out the
> inches because the sign for inches is one double quotation mark ("), which
> gives me the error message "unmatched quote". For example,
> 
> This works: split height, p(' )
> This does not work: split height, p(")
> Nor does this: strparse height, gen(height_in) parse(")
> 
> I also tried variables on this, such as: split height, p(""")
> 
> Any suggestions? Thanks!


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index