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

📄 coefplot.html

📁 偏最小二乘法
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Plot Regression Coefficients of PLSR and PCR models</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 coefplot {pls}"><tr><td>coefplot {pls}</td><td align="right">R Documentation</td></tr></table>
<h2>Plot Regression Coefficients of PLSR and PCR models</h2>


<h3>Description</h3>

<p>
Function to plot the regression coefficients of an <code>mvr</code> object.
</p>


<h3>Usage</h3>

<pre>
coefplot(object, ncomp = object$ncomp, comps, intercept = FALSE,
         separate = FALSE, nCols, nRows, labels, type = "l",
         lty = 1:nLines, lwd = NULL, pch = 1:nLines, cex = NULL,
         col = 1:nLines, legendpos, xlab = "variable",
         ylab = "regression coefficient", pretty.xlabels = TRUE,
         xlim, ...)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>object</code></td>
<td>
an <code>mvr</code> object.  The fitted model.</td></tr>
<tr valign="top"><td><code>ncomp, comps</code></td>
<td>
vector of positive integers.  The components to
plot.  See <code><a href="coef.mvr.html">coef.mvr</a></code> for details.</td></tr>
<tr valign="top"><td><code>separate</code></td>
<td>
logical.  If <code>TRUE</code>, coefficients for different model
sizes are blotted in separate plots.</td></tr>
<tr valign="top"><td><code>intercept</code></td>
<td>
logical.  Whether coefficients for the intercept should
be plotted.  Ignored if <code>comps</code> is specified.  Defaults to
<code>FALSE</code>.  See <code><a href="coef.mvr.html">coef.mvr</a></code> for details.</td></tr>
<tr valign="top"><td><code>nCols, nRows</code></td>
<td>
integer.  The number of coloumns and rows the
plots will be laid out in.  If not specified, <code>coefplot</code> tries
to be intelligent.</td></tr>
<tr valign="top"><td><code>labels</code></td>
<td>
optional.  Alternative <i>x</i> axis labels.  See Details.</td></tr>
<tr valign="top"><td><code>type</code></td>
<td>
character.  What type of plot to make.  Defaults to
<code>"l"</code> (lines).  Alternative types include <code>"p"</code> (points)
and <code>"b"</code> (both).  See <code><a href="../../Zelig/html/plot.zelig.html">plot</a></code> for a complete list
of types.</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>separate</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>).  This only
works well for plots of single-response models.</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 (e.g.,
<code>expression(R^2)</code> 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>coefplot</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>...</code></td>
<td>
Further arguments sent to the underlying plot functions.</td></tr>
</table>

<h3>Details</h3>

<p>
<code>coefplot</code> handles multiple responses by making one plot for each
response.  If <code>separate</code> is <code>TRUE</code>, separate plots are made
for each combination of model size and response.  The plots are laid
out in a rectangular fashion.
</p>
<p>
If <code>legendpos</code> is given, a legend is drawn at the given position
(unless <code>separate</code> is <code>TRUE</code>).
</p>
<p>
The argument <code>labels</code> can be a vector of labels or one of
<code>"names"</code> and <code>"numbers"</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.  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>
<p>
The function can also be called through the <code>mvr</code> plot method by
specifying <code>plottype = "coefficients"</code>.
</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>
The handling of <code>labels</code> and <code>pretty.xlabels</code> is experimental.
</p>


<h3>Author(s)</h3>

<p>
Ron Wehrens and Bj鴕n-Helge Mevik
</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="coef.mvr.html">coef.mvr</a></code>,
<code><a href="../../Zelig/html/plot.zelig.html">plot</a></code>, <code><a href="../../PerformanceAnalytics/html/PerformanceAnalytics-internal.html">legend</a></code>
</p>


<h3>Examples</h3>

<pre>
data(yarn)
mod.nir &lt;- plsr(density ~ NIR, ncomp = 8, data = yarn)
## Not run: 
coefplot(mod.nir, ncomp = 1:6)
plot(mod.nir, plottype = "coefficients", ncomp = 1:6) # Equivalent to the previous
## Plot with legend:
coefplot(mod.nir, ncom = 1:6, legendpos = "bottomright")
## End(Not run)

data(oliveoil)
mod.sens &lt;- plsr(sensory ~ chemical, ncomp = 4, data = oliveoil)
## Not run: coefplot(mod.sens, ncomp = 2:4, separate = TRUE)
</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 + -