predict.groc {groc} | R Documentation |
Predict Method for groc
Description
Prediction for groc models. New responses or scores are predicted using a fitted model and a new matrix of observations.
Usage
## S3 method for class 'groc'
predict(object, newdata, ncomp = object$ncomp, na.action = na.pass, ...)
Arguments
object |
a |
newdata |
a data frame. The new data. If missing, the training data is used. |
ncomp |
vector of positive integers. The components to use in the prediction. |
na.action |
function determining what should be done with missing
values in |
... |
further arguments. Currently not used |
Value
A three dimensional array of predicted response values is returned. The dimensions correspond to the observations, the response variables and the model sizes, respectively.
Author(s)
Martin Bilodeau (bilodeau@dms.umontreal.ca) and Pierre Lafaye de Micheaux (lafaye@unsw.edu.au)
References
Martin Bilodeau, Pierre Lafaye de Micheaux, Smail Mahdi (2015), The R
Package groc for Generalized Regression on Orthogonal Components,
Journal of Statistical Software, 65(1), 1-29,
https://www.jstatsoft.org/v65/i01/
See Also
Examples
data("wood",package="robustbase")
out <- groc(y ~ x1+x2+x3+x4+x5, ncomp=1, data=wood,D=corrob, method="lts")
predict(out)
newdata<- data.frame(x1= 0.5, x2=0.1, x3=0.4, x4=0.5, x5=0.8)
predict(out,newdata)