Hi. This will likely be a banal and rudimentary question. Apologies in advance, but I am stuck nevertheless. To my own disgrace, I am not able to troubleshoot through help format.
I have a string variable imported from an excel file. This string variable is stored as str6 %9s. I need to format this variable such that:
1. There are 6 characters/digits for each observation
2. There is a decimal before the final two characters/digits, and after the first 4.
Current values for this variable, TOP, include:
130800
83700
10100
100810
However, I need these (and all other) values to take the following form:
1308.00
0867.00
0101.00
1008.10
Thanks in advance.
Related Posts with Formatting a String
Syntax for lincom won't work in Stata 16 but works fine in Stata 15Hello all. I'm a professor at Baldwin Wallace. On Thursday, I tried to run a lab with my class from …
Creating unique group ID variableDear all I have a hopefully trivial question that I can't get my head around right now. My data set…
import data from excel to stata-change the structure of the dataHi, I have a data file in excel which includes more than 300 firms. Information for each firm inclu…
How to tag outliers?Hi, I would like to create a dummy that's equal to 1 if it's an outlier, and 0 if not. I can use -ex…
New package predsurv on SSCThanks as always to Kit Baum, a new package predsurv is now available for download from SSC. In Stat…
Subscribe to:
Post Comments (Atom)
0 Response to Formatting a String
Post a Comment