lowess                package:gplots                R Documentation

_S_c_a_t_t_e_r _P_l_o_t _S_m_o_o_t_h_i_n_g

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

     This function performs the computations for the _LOWESS_ smoother
     (see the reference below). 'lowess' returns a list containing
     components 'x' and 'y' which give the coordinates of the smooth.
     The smooth should be added to a plot of the original points with
     the function 'lines'.

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

     lowess(x, ...)
     ## Default S3 method:
     lowess(x, y = NULL, f = 2/3, iter = 3, delta = 0.01 *
                       diff(range(xy$x[o])), ...)
     ## S3 method for class 'formula':
     lowess(formula,data = parent.frame(), subset, na.action, 
                    f=2/3,  iter=3, delta=.01*diff(range(mf[-response])), ... )

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

 formula: formula providing a single dependent variable (y) and an
          single independent variable (x) to use as coordinates in the
          scatter plot.

    data: a data.frame (or list) from which the variables in `formula'
          should be taken.

  subset: an optional vector specifying a subset of observations to be
          used in the fitting process. 

    x, y: vectors giving the coordinates of the points in the scatter
          plot. Alternatively a single plotting structure can be
          specified.

       f: the smoother span. This gives the proportion of points in the
          plot which influence the smooth at each value. Larger values
          give more smoothness.

    iter: the number of robustifying iterations which should be
          performed. Using smaller values of 'iter' will make 'lowess'
          run faster.

   delta: values of 'x' which lie within 'delta' of each other replaced
          by a single value in the output from 'lowess'.

na.action: a function which indicates what should happen when the data
          contain `NA's.  The default is set by the `na.action' setting
          of `options', and is `na.fail' if that is unset. The
          ``factory-fresh'' default is `na.omit'.

     ...: parameters for methods.

_R_e_f_e_r_e_n_c_e_s:

     Cleveland, W. S. (1979) Robust locally weighted regression and
     smoothing scatterplots. _J. Amer. Statist. Assoc._ *74*, 829-836.

     Cleveland, W. S. (1981) LOWESS: A program for smoothing
     scatterplots by robust locally weighted regression. _The American
     Statistician_, *35*, 54.

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

     'loess' (in package 'modreg'), a newer formula based version of
     'lowess' (with different defaults!).

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

     data(cars)

     # default method
     plot(cars, main = "lowess(cars)")
     lines(lowess(cars), col = 2)
     lines(lowess(cars, f=.2), col = 3)
     legend(5, 120, c(paste("f = ", c("2/3", ".2"))), lty = 1, col = 2:3)

     # formula method
     plot(dist ~ speed, data=cars, main = "lowess(cars)")
     lines(lowess(dist ~ speed, data=cars), col = 2)
     lines(lowess(dist ~ speed, data=cars, f=.2), col = 3)
     legend(5, 120, c(paste("f = ", c("2/3", ".2"))), lty = 1, col = 2:3)

