BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
klongway
Calcite | Level 5

Hello,

 

I am trying to write code to calculate my participants birthdates at the time the data was collected. The info for age that was collected was ONLY month and year, so September 1988. My data was collected in 3 months in 2010, also no date available.

 

Any ideas for formatting? Should I put the first or the thirtieth for the days? 

 

Thanks!!!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@klongway wrote:

Hello,

 

I am trying to write code to calculate my participants birthdates at the time the data was collected. The info for age that was collected was ONLY month and year, so September 1988. My data was collected in 3 months in 2010, also no date available.

 

Any ideas for formatting? Should I put the first or the thirtieth for the days? 

 

Thanks!!!


I would tend not to use day 30 because of February. What impact would there be on your analysis or use of a person's age is overestimated by 1 day? 15 days? 30 days? or any other interval? If there is an actual impact then you will have to describe some values and the specific impacts involved.

If there is no specific impact then any "reasonable" rule could be used. I might tend to use mid-month for the data where I have month and year. For a 3-month period without any other date then likely the middle of that period.

Do you need a biologic age, such as 11.43 years, or a "legal" age where that would be truncated to 11? Or do you need other units than years such as weeks or months?

View solution in original post

2 REPLIES 2
ballardw
Super User

@klongway wrote:

Hello,

 

I am trying to write code to calculate my participants birthdates at the time the data was collected. The info for age that was collected was ONLY month and year, so September 1988. My data was collected in 3 months in 2010, also no date available.

 

Any ideas for formatting? Should I put the first or the thirtieth for the days? 

 

Thanks!!!


I would tend not to use day 30 because of February. What impact would there be on your analysis or use of a person's age is overestimated by 1 day? 15 days? 30 days? or any other interval? If there is an actual impact then you will have to describe some values and the specific impacts involved.

If there is no specific impact then any "reasonable" rule could be used. I might tend to use mid-month for the data where I have month and year. For a 3-month period without any other date then likely the middle of that period.

Do you need a biologic age, such as 11.43 years, or a "legal" age where that would be truncated to 11? Or do you need other units than years such as weeks or months?

klongway
Calcite | Level 5
Just a legal age, a whole number!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 400 views
  • 0 likes
  • 2 in conversation