home *** CD-ROM | disk | FTP | other *** search
-
- _F_i_t_t_i_n_g _L_i_n_e_a_r _M_o_d_e_l_s
-
- lm(formula, data, subset, weights, na.action=na.omit)
-
- anova(lm.obj)
- summary(lm.obj)
-
- coefficients(lm.obj)
- deviance(lm.obj)
- df.residual(lm.obj)
- effects(lm.obj)
- fitted.values(lm.obj)
- residuals(lm.obj)
- weights(lm.obj)
-
- lm.fit(x, y)
- lm.w.fit(x, y, w)
-
- _A_r_g_u_m_e_n_t_s:
-
- formula : a symbolic description of the model to be
- fit. The details of model specification are
- given below.
-
- data : an optional data frame containing the vari-
- ables in the model. By default the variables
- are taken from the environment which lm is
- called from.
-
- subset : an optional vector specifying a subset of
- observations to be used in the fitting pro-
- cess.
-
- weights : an optional vector of weights to be used in
- the fitting process.
-
- na.action : a function which indicates what should happen
- when the data contain NAs. The default
- action (na.omit) is to omit any incomplete
- observations. The alternative action na.fail
- causes lm to print an error message and ter-
- minate if there are any incomplete observa-
- tions.
-
- lm.obj : an object of class lm.
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- lm is used to fit linear models. It can be used to
- carry out regression, single stratum analysis of vari-
- ance and analysis of covariance.
-
- Models for lm are specified symbolically. A typical
- model has the form reponse ~ terms where response is
- the (numeric) response vector and terms is a series of
- terms which specifies a linear predictor for response.
- A terms specification of the form first+second indi-
- cates all the terms in first together with all the
- terms in second with duplicates removed. A specifica-
- tion of the form first:second indicates the the set of
- terms obtained by taking the interactions of all terms
- in first with all terms in second. The specification
- first*second indicates the cross of first and second.
- This is the same as first+second+first:second.
-
- _V_a_l_u_e:
-
- lm returns an object of class lm. The function summary
- can be used to obtain or print a summary of the results
- and the function anova and be used to produce and
- analysis of variance table. The generic accessor func-
- tions coefficients, effects, fitted.values and residu-
- als can be used to extract various useful features of
- the value returned by lm.
-
- _S_e_e _A_l_s_o:
-
- anova, coefficients, effects, fitted.values, glm, resi-
- duals, summary.
-
-