predict.asm: Predict new responses using an 'asm' regression model.

View source: R/asm.R

predict.asmR 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,
  debug = FALSE,
  ...
)

Arguments

object

asm object

newdata

new data frame

interval

type of interval calculation, either "none", "confidence" or "prediction". Default is "none".

level

confidence level

debug

boolean; enables debug mode

...

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)
asm_model <- asm(Y ~ X)
predict(asm_model, newdata = data.frame(X = 1), interval = "prediction")


asm documentation built on June 8, 2025, 1:52 p.m.

Related to predict.asm in asm...