turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- RE: Calculation person-year.

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-23-2012 11:49 AM

Hello everyone,

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

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:

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

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.

http://meds.queensu.ca/medicine/obgyn/pdf/what_is/What.is.person-time.pdf

AFAIK There isn't a PROC that can do that for you, you'll need to write your own datastep to solve it.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

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.

Doc Muhlbaier

Duke

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-23-2012 01:48 PM

Hello,

Thanks for your contribution. I will follow-up later.

Thanks

Phan

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-23-2012 01:37 PM

Hello,

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.

Thanks.

Phan

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-23-2012 01:42 PM

Try this Google search, you'll see lots of examples

person-year calculation site:sas.com

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-23-2012 01:53 PM

Phan,

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

*/

data have;

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');

cards;

A 01JAN2007 01JUL2009

B 01JAN2005 01JAN2010

C 01JAN2010 01JUL2011

D 01JUN2007 01JUN2012

E 01JUN2011 01DEC2011

;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-23-2012 02:05 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-23-2012 03:05 PM

Dear Reeza,

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.

Phan

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-25-2012 10:56 AM

Hi Reeza,

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:

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-25-2012 03:04 PM

and When I made the comment I was speaking historically. I've been studying all of the SAS-L postings that have been made since 1986. Each year, over that period, the most frequent posters were male.

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-23-2012 03:08 PM

Dear Art,

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.

Thanks,

Phan

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-23-2012 01:45 PM

Dear Art,

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.

Thanks,

Phan

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-24-2012 05:36 PM

Dear Everyone,

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.

Phan S.

.