I am cleaning someone else's data set, and having trouble with one variable: infant's birth weight. It was recorded as lbs.oz. So, for example, a value of "7.80" means 7lbs 8oz, not 7.8 lbs (which would correspond to 7lbs 12.8 oz). I need to fix this so that, for example, a value of "7.80" means 7.8lbs. I used the command "gen bo_wght_lbs=int(bo_wght)" to create a new variable with the lbs (e.g., the "7"). Now I am at a loss as to how to extrapolate the values after the decimal (e.g., the ".80"). Once I can create a new variable with just the ounces after the decimal point, I can convert it to pounds and combine the two variables together into one variable for lbs. Thanks in advance.
-
Login or Register
- Log in with
Comment