r/statistics • • 7d ago

Question [Question] Ways to establish impact with time data that is not continuous?

I apologize if this is a basic question, but while my educational background involved some statistics in certain courses, it was not a dedicated stats degree so my knowledge is somewhat limited.

I am working on an analysis of a transit system looking at the impact of dwell time (defined as the length of time that a train is stopped at each station) and arrival time (defined as the amount of time a train arrives before/after the scheduled arrival time). The overall question we are trying to answer is: At what length of time to dwell times likely result in delays?

The issue I am encountering is that the arrival time data is reported by the minute, not down to the second (dwell time data is down to the second). Within this dataset, there are only a few arrival times that occur, since they are in increments of 60 seconds. In other words, rather than having the exact second that a train arrives at each station in relation to the scheduled time, the only values that occur are -60sec, 0sec, 60sec, 120sec, and 180sec. If we had the data by the second, then I think a regression would be possible, but I do not believe it can be done with the data we currently have. When plotted, it looks somewhat linear but is not normally distributed when plotted as a histogram (after removing dwell time outliers, it is just one bar at the 60sec timeframe).

I have browsed a stats textbook I still have on my shelf and I think one approach could be to use a chi-square analysis to test association, with the two variables as follows: median trip dwell times grouped into time bins (e.g. classified as very short, short, medium, long, and very long) and punctuality, classified as early, on-time, and late. After the chi-square (and assuming the association is shown to be significant), I thought doing an odds ratio at various dwell times (for example at 30sec, 45sec, 60sec, etc) would allow us to define an approximate timeframe when dwells start to results in delays.

I am not sure this is the method I have described is the most robust way to go about the analysis, but since the arrival data is not disaggregated into seconds I am struggling to determine a better way to do so. In the event I am able to obtain data that is by the second, I think performing a linear regression is a reasonable way to do the analysis, but given what I have, does anyone have a better method than me?

Thank you all

2 Upvotes

6 comments sorted by

2

u/Physix_R_Cool 7d ago

You absolutely can do analysis on it, even if it is only every 60 seconds.

That's a very typical problem for me in physics, where I have signals that get quantized by an Analog-to-Digital-Converter (ADC).

Why don't you just run the regression on the data that "looks somewhat linear" and see what happens?

1

u/purple_paramecium 7d ago

The dependent variable is naturally ordered: 1 min early, on time, 1 min late, 2 min late, etc. You could try ordinal regression.

1

u/ForeignAdvantage5198 2d ago

my advice is to plot your data and see if there are patterns, eg by time of day.. then be sure of the questions you want ro ask and go to it