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
identify repeated observation within variable by idHi, I need to identify by id who has the same grade repeated multiple times. I have used [_n] and […
Matching and clogit functionI am trying to run a binary logistic regression to predict REIT takeover targets. I collected data o…
Declaring data to be time-series dataHi everyone! I have monthly data set presented as such Code: * Example generated by -dataex-. To…
Creating quartiles using loop for 25 continuous independent variablesAny suggestion how to fix this loop ? I am trying to create quartiles for 25 continuous independent …
Which test for between multiple groups and frequencies?Hi all, I am looking at frequencies (how many people said yes or no to a question) and would like t…
Subscribe to:
Post Comments (Atom)
0 Response to Rounding off or changing data type for household id
Post a Comment