predict.groc: Predict Method for groc

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/groc.R

Description

Prediction for groc models. New responses or scores are predicted using a fitted model and a new matrix of observations.

Usage

1
2
## S3 method for class 'groc'
predict(object, newdata, ncomp = object$ncomp, na.action = na.pass, ...)

Arguments

object

a groc object. The fitted model

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 newdata. By default, nothing is done.

...

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

plot.groc

Examples

1
2
3
4
5
6
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)

groc documentation built on Dec. 18, 2020, 9:07 a.m.

Related to predict.groc in groc...