ffL <-
function(x, y)
{
# for unix, use X11() to turn on the graphics device before using this function
# this function makes a FF lambda plot where the competing models are Y^L
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.