kslope:

Usage Arguments Examples

Usage

1
kslope(x, y, pyhat = FALSE, pts = x)

Arguments

x
y
pyhat
pts

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
##---- 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, pyhat = FALSE, pts = x) 
{
    m <- elimna(cbind(x, y))
    x <- m[, 1]
    y <- m[, 2]
    n <- length(y)
    sig <- sqrt(var(x))
    temp <- idealf(x)
    iqr <- (temp$qu - temp$ql)/1.34
    A <- min(c(sig, iqr))
    yhat <- NA
    vval <- NA
    vals <- NA
    rhosq <- NA
    for (k in 1:n) {
        temp1 <- NA
        for (j in 1:n) {
            temp1[j] <- ((x[j] - x[k])/A)^2
        }
        epan <- ifelse(temp1 < 1, 0.75 * (1 - temp1), 0)
        chkit <- sum(epan != 0)
        if (chkit >= 2) {
            temp4 <- lsfit(x, y, wt = epan)
            vals[k] <- temp4$coef[2]
        }
    }
    vals
  }

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