predict: Predict a 'mht' or 'mht.order' object

Description Usage Arguments Details Value See Also Examples

Description

Predict a mht or mht.order object for new data newx

Usage

1
2
3
4
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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)

mht documentation built on May 2, 2019, 11:49 a.m.