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
Max of Previous 2 ObservationsAnother one I can'f figure out myself... Code: * Example generated by -dataex-. To install: ssc in…
Apologies, double post.. …
Two linked variable loopsHi there, I’m fairly new to Stata and would really appreciate some advice with coding. I’m looking…
Weights not allowed with the svy prefixHi Everyone. Can someone please help me, I am new at stata (less than a month). I am in the process…
Testing the difference between two regression coefficientsHi, I am running two regressions using subsets of the data. I wanted to find if the coeffiecients a…
Subscribe to:
Post Comments (Atom)
0 Response to Formatting a String
Post a Comment