Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Patient age at first cancer exam in STATA


From   "[email protected]" <[email protected]>
To   [email protected]
Subject   st: Patient age at first cancer exam in STATA
Date   Sat, 11 Jan 2014 23:08:31 +0100

Hello everybody,

I’m trying to figure out a problem.

I have a file with variables:
1. Patient id
2. Indication if patient suffers from cancer or not (Cancer = 1, no cancer = 0)
3. Date of birth (e.g. 23dec1955)
4. Date of medical exam (e.g. 15aug2005)

I want to create a variable where I would indicate HOW OLD was the
PATIENT when he received his FIRST MEDICAL EXAM and that is for
CANCER.

The problem is that one patient can have many exams for cancer e.g.:

Patid  Cancer      Datebirth   Dateexam
1       0         11jul1985  10aug1999
2       0         11aug1983  10aug1999
2       1         11aug1983  24jun2003
3       1         05aug1933  23aug2007
3       1         05aug1933  20aug2005
4       1         15jun1945  15jan2010
4       1         15jun1945  19feb2005
4       1         15jun1945  23dec2011
5       1         23dec1955  15aug2005

Patient 4 (patid 4) had 3 exams for cancer in 15jan2010, 19feb2005 and
23dec2011, so I just want to know his age in 2005.

Another thing is that patient 1 (patid1) didn’t receive a cancer exam,
so I don’t want to include his result in the variable.

Can anyone help me? Maybe starpen?

Kind Regards

John Cybulski

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index