1 | llressp(x, y)
|
x |
|
y |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ##---- 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)
{
q <- 5
out <- glm(y ~ x[, 1] + x[, 2] + x[, 3] + x[, 4] + x[, 5],
family = poisson)
ESP <- x %*% out$coef[-1] + out$coef[1]
Y <- y
plot(ESP, Y)
abline(mean(y), 0)
fit <- y
fit <- exp(ESP)
indx <- sort.list(ESP)
lines(ESP[indx], fit[indx])
lines(lowess(ESP, y), type = "s")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.