Description Usage Arguments Value Author(s) Examples
This function computes the gap statistic which is used to test for an outlier using Daniels method
1 |
beta |
input - vector of coefficients from saturated model fit to the data |
pse |
input - Lenth's PSE statistic calculated from the elements of beta |
returned gap statistic
John Lawson
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## The function is currently defined as
function (beta, pse)
{
p <- length(beta)
psehe <- pse
sel <- beta >= 0
betap <- beta[sel]
betap <- sort(betap)
betas <- betap[1]
sel <- beta < 0
betan <- beta[sel]
nn <- length(betan)
betan <- sort(betan)
betal <- betan[nn]
zl <- qnorm((nn - 0.375)/(p + 0.25))
zs <- qnorm((nn + 1 - 0.375)/(p + 0.25))
gap <- ((betas - betal)/psehe)/(zs - zl)
return(gap)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.