Hi All,
I am using Stata 13, and I am asking for assistance with what might be a very easy simple solution for one of you.
Center for Disease Control (CDC) growth charts were published using 1 month intervals at 0.5 see the following example (except it starts at month 24). This is available at the following link http://www.cdc.gov/growthcharts/html_charts/bmiagerev.htm
I need to generate child age in months and round down that information to the nearest completed 0.5 month to be able to match the CDC Growth Charts records.
My sample is more than 1900 below is the code that I've used.
This code does not give me what I am looking for. I want the 116 below to show up as 115.5 instead. I obviously don't want to have to manually do that, any suggestions on how I can change those observations? I am aware that rounding to 0.5 means that 66.1 will be rounded as 66, I just could not come up with a better way to write this code. I looked at trunc, floor, ceil and int, and I thought that I can't use them since they return integers.

Thank you for your help!
Patrick
I am using Stata 13, and I am asking for assistance with what might be a very easy simple solution for one of you.
Center for Disease Control (CDC) growth charts were published using 1 month intervals at 0.5 see the following example (except it starts at month 24). This is available at the following link http://www.cdc.gov/growthcharts/html_charts/bmiagerev.htm
I need to generate child age in months and round down that information to the nearest completed 0.5 month to be able to match the CDC Growth Charts records.
My sample is more than 1900 below is the code that I've used.
Code:
gen child_agemonth=(measurement_date1-chd_b_date)/30.4375 replace child_agemonth=round(child_agemonth, 0.5)
Thank you for your help!
Patrick
Comment