predict                package:stats                R Documentation

_M_o_d_e_l _P_r_e_d_i_c_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     'predict' is a generic function for predictions from the results
     of various model fitting functions.  The function invokes
     particular _methods_ which depend on the 'class' of the first
     argument.

_U_s_a_g_e:

     predict (object, ...)

_A_r_g_u_m_e_n_t_s:

  object: a model object for which prediction is desired.

     ...: additional arguments affecting the predictions produced.

_D_e_t_a_i_l_s:

     Most prediction methods which similar to fitting linear models
     have an argument 'newdata' specifiying the first place to look for
     explanatory variables to be used for prediction. Some considerable
     attempts are made to match up the columns in 'newdata' to those
     used for fitting, for example that they are of comparable types
     and that any factors have the same level set in the same order (or
     can be transformed to be so).

     Time series prediction methods in package 'stats' have an argument
     'n.ahead' specifying how many time steps ahead to predict.

     Many methods have a logical argument 'se.fit' saying if standard
     errors are to returned.

_V_a_l_u_e:

     The form of the value returned by 'predict' depends on the class
     of its argument.  See the documentation of the particular methods
     for details of what is produced by that method.

_R_e_f_e_r_e_n_c_e_s:

     Chambers, J. M. and Hastie, T. J. (1992) _Statistical Models in
     S_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'predict.glm', 'predict.lm', 'predict.loess', 'predict.nls',
     'predict.poly', 'predict.princomp', 'predict.smooth.spline'.

     For time-series prediction, 'predict.ar', 'predict.Arima',
     'predict.arima0', 'predict.HoltWinters', 'predict.StructTS'.

_E_x_a_m_p_l_e_s:

     ## All the "predict" methods found
     ## NB most of the methods in the standard packages are hidden.
     for(fn in methods("predict"))
        try({
            f <- eval(substitute(getAnywhere(fn)$objs[[1]], list(fn = fn)))
            cat(fn, ":\n\t", deparse(args(f)), "\n")
            }, silent = TRUE)

