Hello
This is a conceptual question. I have a dataset running into 6000 household ids some of which are in the form 10.1 or 10.2. I had to drop the obs with the decimals above 1 and convert the remaining into integers (say, 10.1 to 10)
In order to append the data with same dataset from another year, I need the household ids in integers and not decimals. I tried rounding off 10.1 to 10 which did not work.
replace hhid =round(hhid, 0.0) (cue taken from a previous statalist query) However, this did not work. I changed the data type of household id from double to int which serves my purpose but I am not sure how right is that. The household ids don't go beyond 6000 so I don't think I am losing precision here. I have read Stata's help section on data_types but my doubt remains. Please correct me where I am wrong. Thanks Smriti
Related Posts with Rounding off or changing data type for household id
Manually calculating IV standard errors and getting STATA to use them in the regression tableI found the following script from one of the other threads to be helpful in calculating IV standard …
Why many commands do not work?Hello dear stata community I am kind of new to stata but I have been facing issues with many command…
Two-Step System GMM with xtabond2 commandDear Stata Experts, I am dealing with a dynamic panel model in which the sample size is 100 firms a…
list if conditionsI used the following code to list the observations in a variable if the binary "check" is 0. But in …
How to shorten multiple line of codes relevant?In my data, I have a numeric number called year which have value from 2 to 22, I want to replace thi…
Subscribe to:
Post Comments (Atom)
0 Response to Rounding off or changing data type for household id
Post a Comment