Cumulative number of events at a given point in time
Sep 14, 2014 1:44 PM(1335 views)
I have a table of events (patient visits in an emergency department), each with a start timestamp and an end timestamp. I would like to visualize (and further analyze) the total number of patient visits (events) occurring at any given point in time.
Conceptually, the bottom chart below represents one horizontal time bar for each event, with a start and end time along the X axis. The upper chart shows a cumulative count of events at any given point.
I'm sure that somewhere buried in JMP is the functionality to do all sorts of robust analysis of data of this sort. Perhaps it's in the Reliability and Survival or Quality and Process platforms. I just can't figure out how to do it. I would really appreciate any advice or direction anybody could provide!
Seans post is a bit old but I would also be interested in hearing an efficient solution to this problem. I think the example below works for Sean, unfortunately, it becomes very inefficient for large data sets.
I will create a datatable 'countatt' to plot the top sketch proposed by Sean.
For my example I will do separate counts for different patient categories and I will automatically update the figure if the original data table is filtered.
I will assume the orginial table is called 'intervaldata' and represents Sean's bottom sketch, and that is has the following columns :Starttime, :Stoptime, :patientcategory.
Create a second data table 'countatT' that has a column :time numbered 0 to the max value found in the intervaldata:StopTime column, do this for each patient category and add a column Patientcat. The result will be something like:
Time, Patientcat, countpercat
0, fractures, 1
0, laceration, 0
1, fractures, 3
To do this add a column 'countpercat' to datatable countatt and define this column formula.
Time = :Time; patientcat = :patiencat; Number(Data Table("intervaldata") << get rows where(time >= :StartTime & time <= :StopTime & :patientcategory == patientcat & Excluded(Row State()) == 0)).
The top graph sketched by Sean can now be created using the graphbuilder with the table 'countatt' as the source. Simply put :Time on the x-axis and put :countpercat on the y-axis with sum as the statistic. In order to show the results per category use : patientcat as the overlay.
If changes are made to the source table ('intervaldata') you can recalculate the table 'countatt'. Unfortunatly, for big tables this can take a long time. Therefor I would be interested to hear about alternative approaches to this problem that are more efficient.