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]

RE: st: RE: Patient age at first cancer exam in STATA


From   Joe Canner <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: RE: Patient age at first cancer exam in STATA
Date   Sun, 12 Jan 2014 00:16:48 +0000

John,

The variable DateCancerDx is the date of the first cancer exam.  However, I just realized that it is only defined when Cancer==1.  To define it for all records, try adding the following:

bysort Patid: egen DateFirstCancerDx=min(DateCancerDx)

For patients who have some records with Cancer==0 and some with Cancer==1 it will set DateFirstCancerDx to DateCancerDx for all records. If all records for a patient have Cancer==0 DateFirstCancerDx will remain missing.

To determine the number of days for which there was a cancer exam, try:

bysort Patid: egen nCancerExam=total(Cancer)

If by "unique" you mean that there might be might be patients with more than one exam on the same day and you only want to count that day once, let us know, since that is more complicated (or, at least, I will have to think a bit longer about it).

Regards,
Joe

________________________________________
From: [email protected] [[email protected]] on behalf of [email protected] [[email protected]]
Sent: Saturday, January 11, 2014 6:54 PM
To: [email protected]
Subject: Re: st: RE: Patient age at first cancer exam in STATA

Dear Joe,

Not all of these patients have cancer, so Dateexam means that on this
date the patient underwent some medical procedure, but it doesn’t
necessary mean that it was an exam for cancer. It could as well be hip
replacement (or any other medical intervention).

It worked thank you very much.

Would you possible also know how to:
1. create a variable, which would put instead of the patients age the
DATE OF FIRST CANCER EXAM?
2. count number of unique days for which there was a cancer exam?

I am so grateful for your help and will be even more. You are saving my life.

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/

*
*   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