Description Usage Arguments Value Examples
View source: R/PredictAdaptiveReg.R
This function predicts the values of the response variables associated to new observations of the explanatory variables.
1 | PredictAdaptiveReg(fit,xnew)
|
fit |
An object containing a fitted model obtained by the |
xnew |
A matrix with p columns containing the new observations of the explanatory variables. |
A vector containing the predicted values of the response variable.
1 2 3 4 5 6 7 8 | library(prospectr)
data(NIRsoil)
indNA = which(is.na(NIRsoil$Nt))
NIRNt = list(x=NIRsoil$spc[-indNA,],y=NIRsoil$Nt[-indNA])
ind.test = sample(1:length(NIRNt$y),50)
fit = AdaptiveReg(NIRNt$x[-ind.test,],NIRNt$y[-ind.test],nvmax=100)
pred = PredictAdaptiveReg(fit,NIRNt$x[ind.test,])
plot(NIRNt$y[ind.test],pred,pch=16,xlab="Y",ylab=expression(hat(Y)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.