predict.asm {asm} | R Documentation |
Predict new responses using an asm
regression model.
Description
Outputs predictions on new test data based on a fitted asm
regression model. Also returns a confidence interval around
the conditional mean (if interval = "confidence") or predicted response (if interval = "prediction").
Usage
## S3 method for class 'asm'
predict(object, newdata = NULL, interval = "none", level = 0.95, ...)
Arguments
object |
asm object |
newdata |
new data frame |
interval |
type of interval calculation, either "none", "confidence" or "prediction". Default is "none". |
level |
confidence level |
... |
additional arguments to ensure compatibility with the generic function predict() |
Value
matrix of predicted values * if interval = "none", the matrix has one column of predicted values * if interval = "confidence" or "prediction", the matrix has three columns: predicted value, lower bound, and upper bound
Examples
model = asm(mpg ~ cyl + hp + disp, data=mtcars)
predict(model, newdata = data.frame(cyl = 4, hp = 121, disp = 80), interval = "prediction")
n <- 1000
X <- rnorm(n)
beta <- 2
Y <- beta*X + rt(n,df=3)
Mod <- asm(Y ~ X)
predict(Mod, newdata = data.frame(X = 1), interval = "prediction")
[Package asm version 0.2.0 Index]