Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Joe Canner <jcanner1@jhmi.edu> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | st: RE: Help with multiple baseline data |
Date | Mon, 9 Sep 2013 14:25:02 +0000 |
Mats, If you save your dates using Stata datetime format, you can simply subtract the baseline date from the follow-up date and get the number of days elapsed: . gen bldate=date(dxdate,"DMY") . gen fudate=date(visdate,"DMY") . gen elapsed=fudate-bldate This should accomplish what you are looking for. If your baseline and follow-up visits are not in the same observation, you can use -reshape- or -bysort- to deal with that. Regards, Joe Canner Johns Hopkins University School of Medicine -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Mats Martinell Sent: Monday, September 09, 2013 10:16 AM To: statalist@hsphsun2.harvard.edu Subject: st: Help with multiple baseline data Dear Statalist, I'm working on a registry of patients with diabetes. The patients (cases) are included at time of diagnosis, thus almost all cases have different dates (ddmmyyyy) for their first registration. The patients are divided into three groups depending on blood sugar concentration at diagnosis. I would like to graph the mean (with 95% CI) blood sugar concentration for each group over time. My problem is the following: 1. Is there a way I can create a common baseline (day 0) from their date of diagnosis for each case? 2. The follow-up measurements are at differentdates and not at a fixed date from diagnosis. Is there a way to generate a variable for the follow-up measurements ( X days after diagnosis (day 0))? Best regards, Mats Martinell PhD stud Uppsala university, Sweden * * 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/