Predict a mht or mht.order object for new data newx
Usage
## S3 method for class 'mht'
predict(object,newx,level,...)
## S3 method for class 'mht.order'
predict(object,newx,level,...)
Arguments
object
Object of class "mht.order" as obtained from mht.order or "mht" as obtained from mht.
newx
Data matrix of size n*p.
level
Level of the prediction interval. Default is 0.95.
...
not used.
Details
The prediction is available for each level alpha of the object. The prediction values and the prediction interval are derived from the predict.lm function. If newx is missing, the fitted values of the object are returned.
Value
Array of predicted values and prediction interval. The third dimension is relative to the type I error alpha -from the initial object-. For each alpha, a matrix with column names fit, lwr, and upr (from predict.lm)
See Also
mht, mht.order, predict.lm
Examples
## Not run:
x=matrix(rnorm(100*20),100,20)
beta=c(rep(2,5),rep(0,15))
y=x%*%beta+rnorm(100)
# mht
mod=mht(x,y,alpha=c(0.1,0.05),maxordre=15)
# predict without new data: gives the fitted values
pred=predict(mod)
# predict with new data
pred=predict(mod,newx=matrix(rnorm(40*20),40,20))
pred
## End(Not run)