Description Usage Arguments Author(s) References Examples
Computes the high breakdown weights used in the HBR GEE estimator
1 |
xmat |
The design matrix. |
y |
The response vector. |
robdis2 |
|
percent |
|
intest |
Joseph W. McKean
Kloke and McKean (2014), Nonparametrics Using R, Boca Raton: Chapman-Hall.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (xmat, y, robdis2 = robdist.hbrfit(xmat), percent = 0.95,
intest = ltsreg(xmat, y)$coef)
{
xmat = as.matrix(xmat)
y = as.matrix(y)
n = dim(xmat)[1]
p = dim(xmat)[2]
cut = qchisq(percent, p)
resids = y - intest[1] - xmat %*% as.matrix(intest[2:(p +
1)])
sigma = mad(resids)
m = psi(cut/robdis2)
a = resids/(sigma * m)
c = (median(a) + 3 * mad(a))^2
h = sqrt(c)/a
ans = psi(abs(h))
ans
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.