khomreg:

Usage Arguments Examples

Usage

1
khomreg(x, y, xout = FALSE, outfun = out, ...)

Arguments

x
y
xout
outfun
...

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
##---- 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 (x, y, xout = FALSE, outfun = out, ...) 
{
    x <- as.matrix(x)
    if (xout) {
        flag <- outfun(x, ...)$keep
        x <- as.matrix(x)
        x <- x[flag, ]
        y <- y[flag]
        x <- as.matrix(x)
    }
    pv <- ncol(x)
    pv1 <- pv + 1
    m <- cbind(x, y)
    m <- elimna(m)
    x <- m[, 1:pv]
    x <- as.matrix(x)
    y <- m[, pv1]
    dvec <- NA
    mat <- matrix(nrow = nrow(x), ncol = pv)
    temp <- lsfit(x, y)
    sigest <- mean(temp$res^2)
    dvec <- y - temp$res
    dbar <- dvec - mean(dvec)
    uval <- temp$res^2
    uval <- as.matrix(uval)
    test <- t(uval) %*% dbar %*% solve(t(dbar) %*% dbar) %*% 
        t(dbar) %*% uval
    psihat <- mean((temp$res^2 - sigest)^2)
    test <- test/psihat
    p.value <- 1 - pchisq(test, 1)
    list(test = test, p.value = p.value)
  }

musto101/wilcox_R documentation built on May 23, 2019, 10:52 a.m.