bestlm                 package:nsRFA                 R Documentation

_S_u_b_s_e_t_s _r_e_g_r_e_s_s_i_o_n

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

     'bestlm' performs an exhaustive search for the best subsets of the
     variables in 'ind'  for predicting 'dip' in linear regression.

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

      bestlm (dip, ind, kmax=4, nbest=3)
      ## S3 method for class 'bestlm':
      print (x, ...)
      ## S3 method for class 'bestlm':
      summary (object, ...)

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

       x: object of class 'bestlm', output of function 'bestlm'

  object: object of class 'bestlm', output of function 'bestlm'

     dip: vector n x 1 of dependent variable to be predicted

     ind: matrix n x K of the K independent variables (candidate
          predictors)

    kmax: maximum size (number of regressors) to report

   nbest: number of subsets of each size to report

     ...: other arguments

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

     This function has been obtained using the function 'leaps' of the
     R package 'leaps'. It is based on the Alan Miller's FORTRAN
     routines.

     Warning: the function will stop with an error if 'ind' is not of
     full rank or if it has more than 31 columns.

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

     'bestlm' returns the following values:

     'subselect' matrix (kmax*nbest)x(ncol(ind)) with the sets of
     chosen linear models, ordered in function of the adjusted
     coefficient of determination (R2adj);

     'R2adj' the ordered adjusted coefficient of determination;

_N_o_t_e:

     For information on the package and the Author, and for all the
     references, see 'nsRFA'.

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

     'lm', 'REGRDIAGNOSTICS'.

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

     data(hydroSIMN)

     bestlm(parameters[,"Dm"], parameters[,-c(1:2)])

     regr <- lm(Dm ~ Am + S2000 + NORD, parameters); regr
     summary(regr)

