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?
How to deal with treatment assignment times vary problem in STATA17?Dear all Statalist experts, today I read the new function of Difference-in-Difference test from STAT…
Issue with Graph Title Position - Issue with Ring positionHello: I'm trying to move a graph title to outside the plot area, specifically above it. I increase…
Seeking help with unbalanced panel data analysisHi, I have recently analyzed an unbalanced panel data, but since it is my first time to work with su…
Collapsing observations in different rowsHi everybody I have some data this way: SP_E_CONSECUTIVO SP_Y_ESP_ENSEÑAR SP_Y_ESP_EVALUAR SP_Y_…
Confusion about the example in STATA help file of didregressToday I read the detail description of didregress from STATA. from page 6 and 7, there is a point th…
Subscribe to:
Post Comments (Atom)
0 Response to How to add zero before the observation in a variable?
Post a Comment