mgvreg:

Usage Arguments Examples

Usage

1
mgvreg(x, y, regfun = tsreg, cov.fun = rmba, se = TRUE, varfun = pbvar, corfun = pbcor, SEED = TRUE)

Arguments

x
y
regfun
cov.fun
se
varfun
corfun
SEED

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
##---- 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, regfun = tsreg, cov.fun = rmba, se = TRUE, varfun = pbvar, 
    corfun = pbcor, SEED = TRUE) 
{
    x = as.matrix(x)
    m <- cbind(x, y)
    m <- elimna(m)
    ivec <- outmgv(m, plotit = FALSE, cov.fun = cov.fun, SEED = SEED)$keep
    np1 <- ncol(x) + 1
    y = m[ivec, np1]
    x = m[ivec, 1:ncol(x)]
    coef <- regfun(x, y)$coef
    vec <- rep(1, length(y))
    residuals <- y - cbind(vec, x) %*% coef
    stre = NULL
    yhat <- y - residuals
    e.pow <- varfun(yhat)/varfun(y)
    if (!is.na(e.pow)) {
        if (e.pow >= 1) 
            e.pow <- corfun(yhat, y)$cor^2
        stre = sqrt(e.pow)
    }
    list(coef = coef, residuals = residuals, Strength.Assoc = stre, 
        Explanatory.Power = e.pow)
  }

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