egp3Thresh: Do a test to suggest two possible thresholds above which...

Description Usage Arguments Details

View source: R/egp3Thresh.R

Description

Do a test to suggest two possible thresholds above which generalized Pareto modelling can be performed The test is written in the context of modelling residual variation in clinical lab safety data and is unlikely to make sense outside of that context

Usage

1
2
3
4
5
6
7
8
9
egp3Thresh(
  data,
  umin = quantile(data, 0.5),
  umax = quantile(data, 0.75),
  nint = 20,
  penalty = "gaussian",
  priorParameters = NULL,
  alpha = 0.05
)

Arguments

data

A vector of value to use, typically residuals from a robust linear model having eliminated the baselne effect and possible a treatment effect

umin

The minumum value to consider as a threshold. Because the data are residuals and will be centered near zero, it defaults to zero. Note that negative values don't make sense since the data need to be positive

umax

The maximum value to consider as a threshold. Clinical trials are usually quite small, so having this as a high quantile would often result in too few observations to meaningfully model. Therefore it defaults to being the upper quartile

nint

The number of positions at which to fit the EGP3 model and plot the power parameter with its approximate confidence interval

penalty

The penalty function to use, if any. By default, maximum likelihood is used with no penalty

priorParameters

Parameters to use in the prior distribution if the likelihood is being penalized

alpha

Determines the coverage of the approximate confidence interval on the power parameter

Details

The EPG3 model of Papastathopoulos and Tawn is fit across a range of thresholds. The threshold at which the confidence interval first contains 1, and at which the point estimate is closest to 1 are returned as suggested thresholds for GPD modelling. The usual diagnostic checks should always be performed.


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