10-23-2012 11:49 AM
I am seeking SAS syntax for 'calculation person-year'. I am interested in looking an incidence rate of first stopping ARV in HIV populations.
I much appreciate anyone helps me with this concept.
Thanks in advance.
10-23-2012 12:41 PM
Couldn't you use the yrdif function (with the age option) to achieve what you want? Take a look at:
10-23-2012 12:46 PM
I think the OP is looking for the epidemiological aspect of person-year, which usually means changing your data structure. But it depends on what format the data is in and what question you're asking.
AFAIK There isn't a PROC that can do that for you, you'll need to write your own datastep to solve it.
10-23-2012 01:35 PM
To follow up on Reeza and Art, the person-year of exposure to ARV would be the difference between the start of ARV and the first stopping (you can do with with yrdif or the approximate formula "(stopdate-startdate)/365.25". To get the overall person-years of exposure, use PROC SUMMARY and get the sum.
10-23-2012 01:37 PM
I do have the Eric document. I helps to understand the concept of person-year. I do agree with you that I have to write code my myself. At the meantime, I don't think I have never seen an example or taught about SAS syntax to apply for person-time.
It would be very helpful if any SAS experts can built an example for this issue for SAS users.
10-23-2012 01:53 PM
I've never worked in the area of epidemiological research, thus am not aware of the various nuances described in the reference that Fareeza provided. However, I'd be interested in knowing why a calculation similar to the calculation of age wouldn't be relevant.
The following mimics one of the examples from that reference:
Time contributed by each subject:
Subject A: 2.5 years
Subject B: 5 years
Subject C: 1.5 years
Subject D: 5 years
Subject E: 0.5 years
informat initial_date onset_date date9.;
format initial_date onset_date date9.;
input subject $ initial_date onset_date;
person_years=yrdif(initial_date, onset_date, 'AGE');
A 01JAN2007 01JUL2009
B 01JAN2005 01JAN2010
C 01JAN2010 01JUL2011
D 01JUN2007 01JUN2012
E 01JUN2011 01DEC2011
10-23-2012 03:05 PM
My sincere apologies as I have difficulties with names. I appreciate and thank for your telling me.
Re. your advice, I will test later tonight and will follow-up.
10-25-2012 10:56 AM
I didn't know either!:smileysilly: Together we are going to change the belief "over the years, males
have dominated the SAS guru level (quoted from Art)". :smileysilly:
10-25-2012 03:04 PM
I don't know if that holds true on the forum, but definitely see a change since at least two of the five with the most points are female.
10-23-2012 03:08 PM
Many thanks for your follow-up. Through Reeze's comments, it appears that you are logic.
I may not have time to run a test at this moment, but will do tonight. I am happy to inform you.
10-23-2012 01:45 PM
I am not sure the 'calculation person-age' is similar to 'person-year' that Reeza has mentioned. He provides a useful document about the concept of 'person-year'.
I am trying to build SAS codes and I would like to share if I achieved.
10-24-2012 05:36 PM
My sincere apology that I couldn't get back last night.
To Art, I tested the yrdif (as well as dtdif) using methods/instructions from SAS Helps, unfortunately I had a message from log file: character values have been converted to numeric values at the places given by ...
I am not sure what is wrong with the code.
Greatly, I used the approximate formula (doc@duke), it appears to be fine for my results.
As Reeze's comment, however, I need to develop several step fro proc summary, proc freq and proc mean to calculate 'sum' of variable that I need.
Overall, I think to calculate person-year is required several steps. These steps are very helpful for new SAS users like me.
One thing that I have no idea for Art is the code does not work. If possible, I will see a stat person in my place if he can help me to identify the erros.
At the meantime, I much appreciate and want to thank everyone in helping me this procedure. Again thanks.