Calculates a bound for the log of the ratio of interim time of two samples (referred to as baseline and treatment) based on partial interval recording (PIR) data, assuming that the average event durations are equal across samples and that interim times are exponentially distributed.
1 2 3 4 5 6 7 8
vector of PIR measurements
factor or vector indicating levels of the PIR measurements.
a character string or value indicating the name of the baseline level.
Desired coverage rate of the calculated confidence interval. Default is
the number of intervals in the sample of observations. Default is
Logical value indicating if the log of the bounds and the confidence interval should be exponentiated. Default is
The interim ratio estimate is based on the assumptions that 1) the underlying behavior stream follows an Alternating Renewal Process, 2) the average event durations in each sample are equal, and 3) interim times follow exponential distributions.
PIR vector can be in any order corresponding to the factor or vector
The levels of
phase can be any two levels, such as "A" and "B", "base" and "treat",
or "0" and "1". If there are more than two levels in
phase this function will not work.
A value for
base_level must be specified; if it is a character string it is case sensitive.
intervals is the number of intervals in the observations.
This is a single value and is assumed to be constant across both samples and all observations.
If intervals is sent as a vector instead of a single value, the first value in the vector will
be used. This value is only relevant if the mean of one of the samples is at the floor or ceiling
of 0 or 1. In that case it will be used to truncate the sample mean. If the sample mean is at the
floor or ceiling and no value for
intervals is provided, the function will stop.
A list with three named entries
The first entry,
estimate_bounds, contains the lower and upper bound for the estimate of the prevalence ratio.
The second entry,
estimate_SE, contains the standard errors for the upper and lower bounds.
The third entry,
estimate_CI, contains the lower and upper bounds for the confidence interval of the prevalence ratio.
Daniel Swan <firstname.lastname@example.org>
1 2 3 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.