| 1 | MLRplot(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 22 23 24 25 26 27 | ##---- 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) 
{
    x <- as.matrix(x)
    out <- lsfit(x, Y)
    cook <- ls.diag(out)$cooks
    n <- dim(x)[1]
    p <- dim(x)[2] + 1
    tem <- cook > min(0.5, (2 * p)/n)
    bhat <- out$coef
    FIT <- bhat[1] + x %*% bhat[-1]
    par(mfrow = c(2, 1))
    plot(FIT, Y)
    abline(0, 1)
    points(FIT[tem], Y[tem], pch = 15)
    identify(FIT, Y)
    title("Forward Response Plot")
    RES <- Y - FIT
    plot(FIT, RES)
    points(FIT[tem], RES[tem], pch = 15)
    identify(FIT, RES)
    title("Residual Plot")
  }
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.