It is a pretty simple formula that will calculate the durations.

And then I just ran a distribution to see the shape of the data, and to get the mean.

In my example below, I only create one new column that determines the duration time spent over 1 SD. The formula is pretty straight forward so using it to calculate the 2SD etc. should be expandable from the first formula.

Here is the JSL to do the calculation and display. This can easily be done interactively.

```
Names Default To Here( 1 );
dt = Current Data Table();
dt << New Column( "sd1 Duration",
Numeric,
"Continuous",
Format( "hr:m:s", 13, 0 ),
Input Format( "hr:m:s", 0 ),
Formula(
If( Row() == 1,
start = 0;
sdLimit = Col Mean( :Count ) + Col Std Dev( :Count );
);
theTime = .;
If( :Count <= sdLimit & start > 0,
theTime = :"Date/Time"n - start;
start = 0;
);
If( :Count > sdLimit & start == 0,
start = :"Date/Time"n
);
theTime;
),
Set Selected
);
Distribution(
Continuous Distribution( Column( :sd1 Duration ), Horizontal Layout( 1 ), Vertical( 0 ) ),
SendToReport(
Dispatch(
{"sd1 Duration"},
"1",
ScaleBox,
{Min( -2009.13865683119 ), Max( 143459.453400931 ), Interval( "Hour" ), Inc( 10 ),
Minor Ticks( 1 )}
),
Dispatch(
{"sd1 Duration"},
"Distrib Histogram",
FrameBox,
{DispatchSeg( Hist Seg( 1 ), Bin Span( 2, 0 ) )}
)
)
);
```

Jim