Decimal time intervals: a cautionary note

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

Decimal time intervals: a cautionary note

Postby jlaake » Fri Apr 27, 2018 12:21 pm

I've been working on a problem (non-robust design) in which I wanted a very small time interval between occasions such that I could assume the time interval was essentially 0. The interval value was of the magnitude 1e-5. Turns out, due to rounding this can cause issues in creating the factor variables for time and age. The symptom was time factor levels that differed slightly even though they should have been the same. In my case the solution was simple. By using an interval of 2e-5 the problem disappeared. Since it is a decimal part of a year this is a 10 minute interval which is clearly plenty small. Had this not been the case, an alternative solution would have been to bin the times such that any rounding was included within the bins.

Moral to the story: Always look at your design data after they are created and modified.

--jeff
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Return to RMark

Who is online

Users browsing this forum: Google [Bot] and 12 guests