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?
twoway histogram gen with 0 frequencyHi! I have a question regarding the twoway histogram gen, which is a subroutine for histogram in St…
How to combine descriptive statistics and ttest resultsArray Hello; I have three dependent variable and all of them are binary, and a list of independent …
dsregress displays undefined error when Estimating lasso for variables of interestI am currently running a series of lasso regressions and I encountered an error that I cannot identi…
generalised DID with two-way fixed modelDear researchers, I have unbalanced panel data for a set of firms for the year that extends from 200…
Stata Probit Model Interaction Term InterpretationHello everyone, for my thesis i am currently investigating the effects of emissions on health on a …
Subscribe to:
Post Comments (Atom)
0 Response to How to add zero before the observation in a variable?
Post a Comment