1 | ffL(x, y)
|
x |
|
y |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##---- 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)
{
n <- length(y)
rmat <- matrix(nrow = n, ncol = 5)
rmat[, 1] <- y - lsfit(x, y)$resid
ytem <- (y^(0.5) - 1)/0.5
rmat[, 2] <- ytem - lsfit(x, ytem)$resid
rmat[, 3] <- log(y) - lsfit(x, log(y))$resid
ytem <- (y^(-0.5) - 1)/-0.5
rmat[, 4] <- ytem - lsfit(x, ytem)$resid
ytem <- (y^(-1) - 1)/-1
rmat[, 5] <- ytem - lsfit(x, ytem)$resid
pairs(rmat, labels = c("YHAT", "YHAT^(0.5)", "YHAT^(0)",
"YHAT^(-0.5)", "YHAT^(-1)"))
min(cor(rmat))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.