1 | diagplot(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 = 7)
out <- lsfit(x, Y)
tem <- ls.diag(out)
rmat[, 1] <- tem$cooks
rmat[, 2] <- tem$hat
rmat[, 3] <- tem$std.res
rmat[, 4] <- tem$stud.res
rmat[, 5] <- tem$dfits
rmat[, 6] <- Y - out$resid
rmat[, 7] <- Y
pairs(rmat, labels = c("Cook's CD", "leverages", "stand resid",
"stud resid", "DFFITS", "YHAT", "Y"))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.