Dear Stata user, Suppose, I have a varibale named "price", which ranges from the 3291 (4 digits) to 15906 (5 digits). Now, I want to convert all observation in to five digits without changing the real value of observations, so i want to add one zero in left side of a observation if that observation is 4 digits. I have used the Stata data for example, so, please consider the following code to get the data,
sysuse auto.dta
sum price
sum price
Variable Obs Mean Std. Dev. Min Max
price 74 6165.257 2949.496 3291 15906
Related Posts with How to add zero before the observation in a variable?
Split String Code: clear input HAVE WANT1 WANT2 AA01 AA 01 AZ02 AZ 02 AV03 AV 03 AA04 AA 0…
xtivreg , first failes with "conformability error" r(503)Dear Readers xtivreg without "first" runs fine, but fails when I add the "first" option with "confo…
Change in variance time seriesHi everyone, I am analysing a time series (stock returns) and I am trying to check whether variance…
How to assess if there is enough variation in your dependent variableIs there a simple way to assess if there is enough variation in your dependent variable, or is it be…
New version of wridit on SSCThanks as always to Kit Baum, a new version of the wridit package is now available for download from…
Subscribe to:
Post Comments (Atom)
0 Response to How to add zero before the observation in a variable?
Post a Comment