1 |
x |
|
y |
|
pcor |
|
regfun |
|
corfun |
|
varfun |
|
xout |
|
outfun |
|
plotit |
|
... |
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 | ##---- 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, pcor = FALSE, regfun = tsreg, corfun = pbcor,
varfun = pbvar, xout = FALSE, outfun = outpro, plotit = FALSE,
...)
{
xx <- elimna(cbind(x, y))
p1 = ncol(xx)
p = p1 - 1
x <- xx[, 1:p]
y <- xx[, p1]
x <- as.matrix(x)
if (xout) {
flag <- outfun(x, plotit = plotit, ...)$keep
x = x[flag, ]
y = y[flag]
}
coef <- regfun(x, y)$coef
yhat <- x %*% coef[2:p1] + coef[1]
stre = NULL
temp = varfun(y)
e.pow = NULL
if (temp > 0)
e.pow <- varfun(yhat)/temp
if (e.pow > 1)
e.pow = corfun(y, yhat)$cor^2
list(Strength.Assoc = e.pow, Explanatory.Power = sqrt(e.pow))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.