| 1 | 
| x | |
| y | |
| RES | |
| varfun | |
| corfun | 
| 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 | ##---- 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, RES = FALSE, varfun = pbvar, corfun = pbcor) 
{
    library(MASS)
    xy = elimna(cbind(x, y))
    p1 = ncol(xy)
    p = p1 - 1
    x = xy[, 1:p]
    y = xy[, p1]
    temp = ltsreg(x, y)$coef
    x = as.matrix(x)
    p = ncol(x) + 1
    res <- y - x %*% temp[2:p] - temp[1]
    yhat <- y - res
    if (!RES) 
        res = NULL
    e.pow <- varfun(yhat)/varfun(y)
    if (is.na(e.pow)) 
        e.pow <- 1
    if (e.pow >= 1) 
        e.pow <- corfun(yhat, y)$cor^2
    list(coef = temp, residuals = res, Explanatory.Power = e.pow, 
        Strength.Assoc = sqrt(e.pow))
  }
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.