home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / lm < prev    next >
Encoding:
Text File  |  1997-04-23  |  2.8 KB  |  82 lines

  1.     
  2.     _F_i_t_t_i_n_g _L_i_n_e_a_r _M_o_d_e_l_s
  3.     
  4.          lm(formula, data, subset, weights, na.action=na.omit)
  5.     
  6.          anova(lm.obj)
  7.          summary(lm.obj)
  8.     
  9.          coefficients(lm.obj)
  10.          deviance(lm.obj)
  11.          df.residual(lm.obj)
  12.          effects(lm.obj)
  13.          fitted.values(lm.obj)
  14.          residuals(lm.obj)
  15.          weights(lm.obj)
  16.     
  17.          lm.fit(x, y)
  18.          lm.w.fit(x, y, w)
  19.     
  20.     _A_r_g_u_m_e_n_t_s:
  21.     
  22.          formula : a symbolic description of the model to be
  23.                    fit.  The details of model specification are
  24.                    given below.
  25.     
  26.             data : an optional data frame containing the vari-
  27.                    ables in the model.  By default the variables
  28.                    are taken from the environment which lm is
  29.                    called from.
  30.     
  31.           subset : an optional vector specifying a subset of
  32.                    observations to be used in the fitting pro-
  33.                    cess.
  34.     
  35.          weights : an optional vector of weights to be used in
  36.                    the fitting process.
  37.     
  38.        na.action : a function which indicates what should happen
  39.                    when the data contain NAs.  The default
  40.                    action (na.omit) is to omit any incomplete
  41.                    observations.  The alternative action na.fail
  42.                    causes lm to print an error message and ter-
  43.                    minate if there are any incomplete observa-
  44.                    tions.
  45.     
  46.           lm.obj : an object of class lm.
  47.     
  48.     _D_e_s_c_r_i_p_t_i_o_n:
  49.     
  50.          lm is used to fit linear models.  It can be used to
  51.          carry out regression, single stratum analysis of vari-
  52.          ance and analysis of covariance.
  53.     
  54.          Models for lm are specified symbolically.  A typical
  55.          model has the form reponse ~ terms where response is
  56.          the (numeric) response vector and terms is a series of
  57.          terms which specifies a linear predictor for response.
  58.          A terms specification of the form first+second indi-
  59.          cates all the terms in first together with all the
  60.          terms in second with duplicates removed.  A specifica-
  61.          tion of the form first:second indicates the the set of
  62.          terms obtained by taking the interactions of all terms
  63.          in first with all terms in second.  The specification
  64.          first*second indicates the cross of first and second.
  65.          This is the same as first+second+first:second.
  66.     
  67.     _V_a_l_u_e:
  68.     
  69.          lm returns an object of class lm.  The function summary
  70.          can be used to obtain or print a summary of the results
  71.          and the function anova and be used to produce and
  72.          analysis of variance table.  The generic accessor func-
  73.          tions coefficients, effects, fitted.values and residu-
  74.          als can be used to extract various useful features of
  75.          the value returned by lm.
  76.     
  77.     _S_e_e _A_l_s_o:
  78.     
  79.          anova, coefficients, effects, fitted.values, glm, resi-
  80.          duals, summary.
  81.     
  82.