hbrwtsnew: HBR Weights

Description Usage Arguments Author(s) References Examples

Description

Computes the high breakdown weights used in the HBR GEE estimator

Usage

1
hbrwtsnew(xmat, y, robdis2 = robdist.hbrfit(xmat), percent = 0.95, intest = ltsreg(xmat, y)$coef)

Arguments

xmat

The design matrix.

y

The response vector.

robdis2
percent
intest

Author(s)

Joseph W. McKean

References

Kloke and McKean (2014), Nonparametrics Using R, Boca Raton: Chapman-Hall.

Examples

 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
  }

kloke/rbgee documentation built on May 20, 2019, 12:34 p.m.