pExcessByBaseline: Compute the probability of a threshold exceedance across a...

Description Usage Arguments Details Value Note

View source: R/pexcess.R

Description

Compute the probability of a threshold exceedance across a range of baseline values

Usage

1
pExcessByBaseline(object, M, n = 200)

Arguments

object

An object of class 'margarita'

M

The threshold of interest. M must be of length 1 and is assumed to be on the scale of the raw data.

n

The number of values to compute the probability at. Defaults to n=200. Using n=50 would be faster, but the resulting graph would be less smooth.

Details

Creates a sequency of n equally spaced values between the minimum and maximum of the baseline values in the robust regression component of the margarita object, repeats this sequence for each level of the treatment factor, gets the fitted values from the robust regression for each baseline and treatment, then adds the GP modelling threshold as obtained from the evmSim component of the margarita object. The function then uses predict.evmSim to compute the parameter matrix from the Markov chains and then computes the probability of exceeding M across the range of baseline values and treatment factors.

Value

A data.frame with columns for baseline, treatment, threshold (linear model fitted value plus GP threshold) and a summary of the distribution of the probabilities of exceeding M. The means and medians ought to be similar. Presumably a plot of the mean over the range of baseline values is desired. The expected probabilities could also be used to integrate over the observed baseline distribution to obtain an estimate of the population probability of exceeding M.

Note

WARNING: the code has been tested with treatment as a factor and as linear numeric. More complicated structures, such as a combo of a factor and a linear effect are unliekly to work. There is a test function. Take a look at it.


harrysouthworth/margarita documentation built on Aug. 19, 2021, 5 a.m.