predplot                 package:pls                 R Documentation

_P_r_e_d_i_c_t_i_o_n _P_l_o_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Functions to plot predicted values against measured values for a
     fitted model.

_U_s_a_g_e:

     predplot(object, ...)
     ## Default S3 method:
     predplot(object, ...)
     ## S3 method for class 'mvr':
     predplot(object, ncomp = object$ncomp, which, newdata, nCols, 
              nRows, ...)
     predplotXy(x, y, line = FALSE, main = "Prediction plot",
                xlab = "measured response", ylab = "predicted response", ...)

_A_r_g_u_m_e_n_t_s:

  object: a fitted model.

   ncomp: integer vector.  The model sizes (numbers of components) to
          use for prediction.

   which: character vector.  Which types of predictions to plot. Should
          be a subset of 'c("train", "validation", "test")'.  If not
          specified, 'plot.mvr' selects test set predictions if
          'newdata' is supplied, otherwise cross-validated predictions
          if the model has been cross-validated, otherwise fitted
          values from the calibration data.

 newdata: data frame.  New data to predict.

nCols, nRows: integer.  The number of coloumns and rows the plots will
          be laid out in.  If not specified, 'plot.mvr' tries to be
          intelligent.

       x: numeric vector.  The observed response values.

       y: numeric vector.  The predicted response values.

    line: logical.  Whether a target line should be shown.

    main: character.  Main title of plot.

    xlab: character.  X axis label.

    ylab: character.  Y axis label.

     ...: further arguments sent to underlying plot functions.

_D_e_t_a_i_l_s:

     'predplot' is a generic function for plotting predicted versus
     measured response values, with default and 'mvr' methods currently
     implemented.  The default method is very simple, and doesn't
     handle multiple responses or new data.

     The 'mvr' method, 'predplot.mvr' handles multiple responses, model
     sizes and types of predictions by making one plot for each
     combination.  It can also be called through the plot method for
     'mvr', by specifying 'plottype = "prediction"' (the default).

     'predplotXy' is an internal function and is not meant for
     interactive use.

_V_a_l_u_e:

     The functions invisibly returns a matrix with the (last) plotted
     data.

_A_u_t_h_o_r(_s):

     Ron Wehrens and Bjrn-Helge Mevik

_S_e_e _A_l_s_o:

     'mvr', 'plot.mvr'

_E_x_a_m_p_l_e_s:

     data(NIR)
     mod <- plsr(y ~ X, ncomp = 10, data = NIR[NIR$train,], CV = TRUE)
     ## Not run: 
     predplot(mod, ncomp = 1:6)
     plot(mod, ncomp = 1:6) # Equivalent to the previous
     ## Both cross-validated and test set predictions:
     predplot(mod, ncomp = 4:6, which = c("validation", "test"),
              newdata = NIR[!NIR$train,])
     ## End(Not run)

     data(sensory)
     mod.sens <- plsr(Quality ~ Panel, ncomp = 4, data = sensory)
     ## Not run: plot(mod.sens, ncomp = 2:4) # Several responses gives several plots

