1 |
x |
|
y |
|
locfun |
|
varfun |
|
nboot |
|
SEED |
|
... |
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, locfun = tmean, varfun = winvarN, nboot = 100,
SEED = TRUE, ...)
{
library(MASS)
if (SEED)
set.seed(2)
x <- x[!is.na(x)]
y <- y[!is.na(y)]
n1 = length(x)
n2 = length(y)
if (n1 == n2) {
temp = effectg.sub(x, y, locfun = locfun, varfun = varfun,
...)
e.pow = temp$Var.Explained
}
if (n1 != n2) {
N = min(c(n1, n2))
vals = 0
for (i in 1:nboot) vals[i] = effectg.sub(sample(x, N),
sample(y, N), locfun = locfun, varfun = varfun, ...)$Var.Explained
e.pow = mean(vals)
}
list(Explanatory.power = e.pow, Effect.Size = sqrt(e.pow))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.