The R Project SVN R

Rev

Rev 59039 | Rev 68948 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
42333 ripley 1
% File src/library/stats/man/screeplot.Rd
2
% Part of the R package, http://www.R-project.org
59039 ripley 3
% Copyright 1995-2007 R Core Team
42333 ripley 4
% Distributed under GPL 2 or later
5
 
27474 ripley 6
\name{screeplot}
56186 murdoch 7
\alias{screeplot}
40852 maechler 8
\alias{screeplot.default}
9
\title{Screeplots}
27474 ripley 10
\usage{
40852 maechler 11
\method{screeplot}{default}(x, npcs = min(10, length(x$sdev)),
30912 ripley 12
          type = c("barplot", "lines"),
13
          main = deparse(substitute(x)), \dots)
27474 ripley 14
}
15
\arguments{
40852 maechler 16
  \item{x}{an object containing a \code{sdev} component, such as that
40979 hornik 17
    returned by \code{\link{princomp}()} and \code{\link{prcomp}()}.}
40852 maechler 18
  \item{npcs}{the number of components to be plotted.}
27474 ripley 19
  \item{type}{the type of plot.}
20
  \item{main, \dots}{graphics parameters.}
21
}
22
\description{
40852 maechler 23
  \code{screeplot.default} plots the variances against the number of the
24
  principal component. This is also the \code{plot} method for classes
25
  \code{"princomp"} and \code{"prcomp"}.
27474 ripley 26
}
27
\references{
28
  Mardia, K. V., J. T. Kent and J. M. Bibby (1979).
29
  \emph{Multivariate Analysis}, London: Academic Press.
30
 
31
  Venables, W. N. and B. D. Ripley (2002).
32
  \emph{Modern Applied Statistics with S}, Springer-Verlag.
33
}
34
\seealso{
40852 maechler 35
  \code{\link{princomp}} and \code{\link{prcomp}}.
27474 ripley 36
}
37
\examples{
41508 ripley 38
require(graphics)
39
 
27474 ripley 40
## The variances of the variables in the
41
## USArrests data vary by orders of magnitude, so scaling is appropriate
42
(pc.cr <- princomp(USArrests, cor = TRUE))  # inappropriate
43
screeplot(pc.cr)
44
 
61160 ripley 45
fit <- princomp(covmat = Harman74.cor)
27474 ripley 46
screeplot(fit)
61160 ripley 47
screeplot(fit, npcs = 24, type = "lines")
27474 ripley 48
}
49
\keyword{multivariate}