The R Project SVN R

Rev

Rev 88598 | 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
68948 ripley 2
% Part of the R package, https://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}
85983 hornik 9
\title{Scree Plots}
27474 ripley 10
\usage{
83727 hornik 11
screeplot(x, \dots)
40852 maechler 12
\method{screeplot}{default}(x, npcs = min(10, length(x$sdev)),
30912 ripley 13
          type = c("barplot", "lines"),
77594 maechler 14
          main = deparse1(substitute(x)), \dots)
27474 ripley 15
}
16
\arguments{
40852 maechler 17
  \item{x}{an object containing a \code{sdev} component, such as that
40979 hornik 18
    returned by \code{\link{princomp}()} and \code{\link{prcomp}()}.}
40852 maechler 19
  \item{npcs}{the number of components to be plotted.}
68055 ripley 20
  \item{type}{the type of plot.  Can be abbreviated.}
27474 ripley 21
  \item{main, \dots}{graphics parameters.}
22
}
23
\description{
40852 maechler 24
  \code{screeplot.default} plots the variances against the number of the
25
  principal component. This is also the \code{plot} method for classes
26
  \code{"princomp"} and \code{"prcomp"}.
27474 ripley 27
}
28
\references{
88598 hornik 29
  \bibshow{R:Mardia+Kent+Bibby:1979,
30
    R:Venables+Ripley:2002}
27474 ripley 31
}
32
\seealso{
40852 maechler 33
  \code{\link{princomp}} and \code{\link{prcomp}}.
27474 ripley 34
}
35
\examples{
41508 ripley 36
require(graphics)
37
 
27474 ripley 38
## The variances of the variables in the
39
## USArrests data vary by orders of magnitude, so scaling is appropriate
40
(pc.cr <- princomp(USArrests, cor = TRUE))  # inappropriate
41
screeplot(pc.cr)
42
 
61160 ripley 43
fit <- princomp(covmat = Harman74.cor)
27474 ripley 44
screeplot(fit)
61160 ripley 45
screeplot(fit, npcs = 24, type = "lines")
27474 ripley 46
}
47
\keyword{multivariate}
89418 smeyer 48
\keyword{hplot}