From a data.table
containing the log-likelihoods for all event types,
and for the null hypothesis of no event, calculates the log-likelihood ratios
by subtracting null log-likelihoods from the event log-likelihoods,
for each location, stream, and event duration.
add_llr(loglikelihoods, null_name)
A data.table
containing at least the columns
event, location, stream, duration
and loglikelihood
. The
first four columns must be key columns, in that order. The column
event
contains all event types (given e.g. as integers or strings)
and also the null hypothesis, as specified by the argument
null_name
.
The identifier for the null hypothesis in the column
event
of the input argument loglikelihoods
. E.g. 0L
if event types are specified as integers, or "null"
if event types
are specified as strings.
A data.table
with key columns location, event, stream,
duration
, and a column llr
containing the log-likelihood ratios for
each event type.