Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Using Stata to calculate proportion of observation time abovea threshold value i.e. "time in range"


From   "Andrew O'Connor DO" <[email protected]>
To   <[email protected]>
Subject   st: Using Stata to calculate proportion of observation time abovea threshold value i.e. "time in range"
Date   Wed, 25 Apr 2007 08:31:33 -0400

I'm hoping someone can help me with a data problem (Nik sorry I emailed
you directly rather than putting on the list).

A person I work with was able to calculate this in SAS and I'm hopefully
able to do the same in STATA.  I'm trying to use stata to calculate a
time in range for blood pressure data
here is what my data looks like
------------------------------
-----------------------------------------------------------------
Pt_ID    Appt_date appt_status      bp_systolic
   1         21 Apr 05    No Show      
   1       07 Jun 05     Completed       140
   1     11 Jan 06     Completed         150
   1       16 Feb 06    Completed        150
   1       30 Mar 06    Canceled      
   1       02 May 06   Canceled      
   1       09 May 06   Completed        138
   1       11 Jul 06     Completed        142
   1       19 Sep 06   Completed        150
   2       30 May 06   No Show     
   2       11 Jul 06     Completed        176
   2       25 Jul 06     Completed        121
   2       01 Aug 06    Canceled  
   2       01 Aug 06    Completed       101
   2       15 Aug 06    Completed       118
   2       22 Aug 06    Canceled
   2       12 Sep 06    Completed       136
   2       14 Nov 06    Completed        137
   2       16 Jan 07     Completed       113
   2        06 Feb 07    No Show  
   2        03 May 06    Canceled    
   2        25 Jul 06      Canceled 
   2        01 Aug 06    Canceled   
   2        07 Feb 07    Canceled  
-------------------------------------------------------------------------------------------------------
Basically I assume a linear slope (interpolated) between successive
dates, set a threshold, then ask STATA to calculate the proportion of
total observation time that the curve was above my threshold.

I think this falls under the cross sectional time series definition. 
Basically what I'm trying to do is each individual (where iis Pt_ID) has
a unique observation time (tis Appt_date) and a set of observed systolic
blood pressures (bp_systolic).  There are no set observation times, this
is observational data.  For each time, I assume a linear slope of blood
pressure change to the next observation time.  I need to calculate the
area that the slope measure predicts blood pressure over my threshold
(say 140 for example).  Slopes can be positive or negative or flat. 
Each individual has a variable number of observations, they are not
equally spaced, and missing data is a possibility.

Andrew O'Connor, DO, MPH
Division of Nephrology
Case Western Reserve University


The MetroHealth System: Saving lives in Northeast Ohio for 170 
years as the region's leader in critical care, community health 
and rehabilitation.  Visit us at http://www.MetroHealth.org for 
a complete list of services, health care providers, and 
locations.

This email and all attachments that may have been included are 
intended only for the use of the party to whom/which the email 
is addressed and may contain information that is privileged, 
confidential, or exempt from disclosure under applicable law. 
If you are not the addressee or the employee or agent of the 
intended recipient, you are hereby notified that you are 
strictly prohibited from printing, storing, disseminating, 
distributing, or copying this communication. If you have 
received this notification in error, please contact the 
Director of Risk/Privacy Management at (216)778-5728. For a copy 
of our Notice of Privacy Practices, please visit: 
http://www.metrohealth.org/general/privacy.asp 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index