screeplot               package:stats               R Documentation

_S_c_r_e_e_p_l_o_t_s

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

     'screeplot.default' plots the variances against the number of the
     principal component. This is also the 'plot' method for classes
     '"princomp"' and '"prcomp"'.

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

     ## Default S3 method:
     screeplot(x, npcs = min(10, length(x$sdev)),
               type = c("barplot", "lines"),
               main = deparse(substitute(x)), ...)

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

       x: an object containing a 'sdev' component, such as that
          returned by 'princomp()' and 'prcomp()'.

    npcs: the number of components to be plotted.

    type: the type of plot.

main, ...: graphics parameters.

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

     Mardia, K. V., J. T. Kent and J. M. Bibby (1979). _Multivariate
     Analysis_, London: Academic Press.

     Venables, W. N. and B. D. Ripley (2002). _Modern Applied
     Statistics with S_, Springer-Verlag.

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

     'princomp' and 'prcomp'.

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

     require(graphics)

     ## The variances of the variables in the
     ## USArrests data vary by orders of magnitude, so scaling is appropriate
     (pc.cr <- princomp(USArrests, cor = TRUE))  # inappropriate
     screeplot(pc.cr)

     fit <- princomp(covmat=Harman74.cor)
     screeplot(fit)
     screeplot(fit, npcs=24, type="lines")

