⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scoreplot.html

📁 偏最小二乘法
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Plots of Scores, Loadings and Correlation Loadings</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>

<table width="100%" summary="page for scoreplot {pls}"><tr><td>scoreplot {pls}</td><td align="right">R Documentation</td></tr></table>
<h2>Plots of Scores, Loadings and Correlation Loadings</h2>


<h3>Description</h3>

<p>
Functions to make scatter plots of scores or correlation loadings, and
scatter or line plots of loadings.
</p>


<h3>Usage</h3>

<pre>
scoreplot(object, ...)
## Default S3 method:
scoreplot(object, comps = 1:2, labels, identify = FALSE, type = "p",
          xlab, ylab, ...)
## S3 method for class 'scores':
plot(x, ...)

loadingplot(object, ...)
## Default S3 method:
loadingplot(object, comps = 1:2, scatter = FALSE, labels,
            identify = FALSE, type, lty, lwd = NULL, pch, cex = NULL,
            col, legendpos, xlab, ylab, pretty.xlabels = TRUE, xlim, ...)
## S3 method for class 'loadings':
plot(x, ...)

corrplot(object, comps = 1:2, labels, radii = c(sqrt(1/2), 1),
         identify = FALSE, type = "p", xlab, ylab, ...)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>object</code></td>
<td>
an <font face="Courier New,Courier" color="#666666"><b>R</b></font> object.  The fitted model.</td></tr>
<tr valign="top"><td><code>comps</code></td>
<td>
integer vector.  The components to plot.</td></tr>
<tr valign="top"><td><code>scatter</code></td>
<td>
logical.  Whether the loadings should be plotted as a
scatter instead of as lines.</td></tr>
<tr valign="top"><td><code>labels</code></td>
<td>
optional.  Alternative plot labels or <i>x</i> axis labels.
See Details.</td></tr>
<tr valign="top"><td><code>radii</code></td>
<td>
numeric vector, giving the radii of the circles drawn in
<code>corrplot</code>.  The default radii represent 50% and 100%
explained variance of the <i>X</i> variables by the chosen components.</td></tr>
<tr valign="top"><td><code>identify</code></td>
<td>
logical.  Whether to use <code>identify</code> to
interactively identify points.  See below.</td></tr>
<tr valign="top"><td><code>type</code></td>
<td>
character.  What type of plot to make.  Defaults to
<code>"p"</code> (points) for scatter plots and <code>"l"</code> (lines) for
line plots.  See <code><a href="../../Zelig/html/plot.zelig.html">plot</a></code> for a complete list
of types (not all types are possible/meaningful for all plots).</td></tr>
<tr valign="top"><td><code>lty</code></td>
<td>
vector of line types (recycled as neccessary).  Line types can be
specified as integers or character strings (see <code><a href="../../graphics/html/par.html">par</a></code>
for the details).</td></tr>
<tr valign="top"><td><code>lwd</code></td>
<td>
vector of positive numbers (recycled as neccessary), giving
the width of the lines.</td></tr>
<tr valign="top"><td><code>pch</code></td>
<td>
plot character.  A character string or a vector of
single characters or integers (recycled as neccessary).  See
<code><a href="../../graphics/html/points.html">points</a></code> for all alternatives.</td></tr>
<tr valign="top"><td><code>cex</code></td>
<td>
numeric vector of character expansion sizes (recycled as
neccessary) for the plotted symbols.</td></tr>
<tr valign="top"><td><code>col</code></td>
<td>
character or integer vector of colors for plotted lines and
symbols (recycled as neccessary).  See <code><a href="../../graphics/html/par.html">par</a></code> for the details.</td></tr>
<tr valign="top"><td><code>legendpos</code></td>
<td>
Legend position.  Optional.  Ignored if <code>scatter</code> is
<code>TRUE</code>.  If present, a legend is drawn at the given position.
The position can be specified symbolically (e.g., <code>legendpos =
      "topright"</code>).  This requires <font face="Courier New,Courier" color="#666666"><b>R</b></font> &gt;= 2.1.0.  Alternatively, the
position can be specified explicitly (<code>legendpos = t(c(x,y))</code>)
or interactively (<code>legendpos = <a href="../../graphics/html/locator.html">locator</a>()</code>).</td></tr>
<tr valign="top"><td><code>xlab,ylab</code></td>
<td>
titles for <i>x</i> and <i>y</i> axes.  Typically
character strings, but can be expressions or lists.  See
<code><a href="../../graphics/html/title.html">title</a></code> for details.</td></tr>
<tr valign="top"><td><code>pretty.xlabels</code></td>
<td>
logical.  If <code>TRUE</code>, <code>loadingplot</code>
tries to plot the <i>x</i> labels more nicely.  See Details.</td></tr>
<tr valign="top"><td><code>xlim</code></td>
<td>
optional vector of length two, with the <i>x</i> limits of
the plot.</td></tr>
<tr valign="top"><td><code>x</code></td>
<td>
a <code>scores</code> or <code>loadings</code> object.  The scores or
loadings to plot.</td></tr>
<tr valign="top"><td><code>...</code></td>
<td>
further arguments sent to the underlying plot function(s).</td></tr>
</table>

<h3>Details</h3>

<p>
<code>plot.scores</code> is simply a wrapper calling <code>scoreplot</code>,
passing all arguments.  Similarly for <code>plot.loadings</code>.
</p>
<p>
<code>scoreplot</code> is generic, currently with a default method that
works for matrices and any object for which <code><a href="scores.html">scores</a></code>
returns a matrix.  The default <code>scoreplot</code> method
makes one or more scatter plots of the scores,
depending on how many components are selected.  If one or two
components are selected, and <code>identify</code> is <code>TRUE</code>, the
function <code><a href="../../graphics/html/identify.html">identify</a></code> is used to interactively identify
points.
</p>
<p>
Also <code>loadingplot</code> is generic, with a default method that works
for matrices and any object where <code><a href="scores.html">loadings</a></code> returns a
matrix.  If <code>scatter</code> is <code>TRUE</code>, the default method works exactly
like the default <code>scoreplot</code> method.  Otherwise, it makes a lineplot of the selected
loading vectors, and if <code>identify</code> is <code>TRUE</code>,
uses <code><a href="../../graphics/html/identify.html">identify</a></code> to interactively identify points.  Also,
if <code>legendpos</code> is given, a legend is drawn at the position
indicated.
</p>
<p>
<code>corrplot</code> works exactly like the default <code>scoreplot</code>
method, except that at least two components must be selected.  The
&ldquo;correlation loadings&rdquo;, i.e. the correlations between each
variable and the selected components (see References), are plotted as pairwise scatter
plots, with concentric circles of radii given by <code>radii</code>.  Each
point corresponds to an <i>X</i> variable.  The squared distance
between the point and origin equals the fraction of the variance of the
variable explained by the components in the panel.  The default
<code>radii</code> corresponds to 50% and 100% explained variance.
</p>
<p>
<code>scoreplot</code>, <code>loadingplot</code> and <code>corrplot</code> can also be
called through the plot method for <code>mvr</code> objects, by specifying
<code>plottype</code> as <code>"scores"</code>, <code>"loadings"</code> or
<code>"correlation"</code>, respectively.  See <code><a href="plot.mvr.html">plot.mvr</a></code>.
</p>
<p>
The argument <code>labels</code> can be a vector of labels or one of
<code>"names"</code> and <code>"numbers"</code>.  
</p>
<p>
If a scatter plot is produced (i.e., <code>scoreplot</code>, <code>corrplot</code>, or
<code>loadingplot</code> with <code>scatter = TRUE</code>), the labels
are used instead of plot symbols for the points plotted.  If
<code>labels</code> is <code>"names"</code> or <code>"numbers"</code>, the row
names or row numbers of the matrix (scores, loadings or correlation
loadings) are used.
</p>
<p>
If a line plot is produced (i.e., <code>loadingplot</code>), the labels are
used as <i>x</i> axis labels.  If <code>labels</code> is <code>"names"</code> or
<code>"numbers"</code>, the variable names are used as labels, the
difference being that with <code>"numbers"</code>, the variable names are
converted to numbers, if possible.  Variable names of the forms
<SAMP>"number"</SAMP> or <SAMP>"number text"</SAMP> (where the space is optional),
are handled.
</p>
<p>
The argument <code>pretty.xlabels</code> is only used when <code>labels</code> is
specified for a line plot.  If <code>TRUE</code> (default), the code tries
to use a &lsquo;pretty&rsquo; selection of labels.  If <code>labels</code> is
<code>"numbers"</code>, it also uses the numerical values of the labels for
horisontal spacing.  If one has excluded parts of the spectral
region, one might therefore want to use <code>pretty.xlabels = FALSE</code>.
</p>


<h3>Value</h3>

<p>
The functions return whatever the underlying plot function (or
<code>identify</code>) returns.</p>

<h3>Note</h3>

<p>
<code><a href="../../PerformanceAnalytics/html/PerformanceAnalytics-internal.html">legend</a></code> has many options.  If you want greater
control over the appearance of the legend, omit the <code>legendpos</code>
argument and call <code>legend</code> manually.
</p>
<p>
Graphical parametres (such as <code>pch</code> and <code>cex</code>) can also
be used with <code>scoreplot</code> and <code>corrplot</code>.  They are not
listed in the argument list simply because they are not handled
specifically in the function (unlike in <code>loadingplot</code>), but
passed directly to the underlying plot functions by <code>...</code>.
</p>
<p>
The handling of <code>labels</code> and <code>pretty.xlabels</code> in
<code>coefplot</code> is experimental.
</p>


<h3>Author(s)</h3>

<p>
Ron Wehrens and Bj鴕n-Helge Mevik
</p>


<h3>References</h3>

<p>
Martens, H., Martens, M. (2000) Modified Jack-knife Estimation of
Parameter Uncertainty in Bilinear Modelling by Partial Least Squares
Regression (PLSR).
<EM>Food Quality and Preference</EM>, <B>11</B>(1&ndash;2), 5&ndash;16.
</p>


<h3>See Also</h3>

<p>
<code><a href="mvr.html">mvr</a></code>, <code><a href="plot.mvr.html">plot.mvr</a></code>,
<code><a href="scores.html">scores</a></code>, <code><a href="scores.html">loadings</a></code>, <code><a href="../../graphics/html/identify.html">identify</a></code>,
<code><a href="../../PerformanceAnalytics/html/PerformanceAnalytics-internal.html">legend</a></code>
</p>


<h3>Examples</h3>

<pre>
data(yarn)
mod &lt;- plsr(density ~ NIR, ncomp = 10, data = yarn)
## These three are equivalent:
## Not run: 
scoreplot(mod, comps = 1:5)
plot(scores(mod), comps = 1:5)
plot(mod, plottype = "scores", comps = 1:5)

loadingplot(mod, comps = 1:5)
loadingplot(mod, comps = 1:5, legendpos = "topright") # With legend
loadingplot(mod, comps = 1:5, scatter = TRUE) # Plot as scatterplots

corrplot(mod, comps = 1:2)
corrplot(mod, comps = 1:3)
## End(Not run)
</pre>



<hr><div align="center">[Package <em>pls</em> version 2.0-1 <a href="00Index.html">Index]</a></div>

</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -