📄 validationplot.html
字号:
<html><head><title>R: Validation Plots</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 validationplot {pls}"><tr><td>validationplot {pls}</td><td align="right">R Documentation</td></tr></table>
<h2>Validation Plots</h2>
<h3>Description</h3>
<p>
Functions to plot validation statistics, such as RMSEP or R2, as a
function of the number of components.
</p>
<h3>Usage</h3>
<pre>
validationplot(object, val.type = c("RMSEP", "MSEP", "R2"), estimate,
newdata, comps, intercept, ...)
## S3 method for class 'mvrVal':
plot(x, nCols, nRows, type = "l", lty = 1:nEst, lwd = NULL,
pch = 1:nEst, cex = NULL, col = 1:nEst, legendpos,
xlab = "number of components", ylab = x$type, ...)
</pre>
<h3>Arguments</h3>
<table summary="R argblock">
<tr valign="top"><td><code>object</code></td>
<td>
an <code>mvr</code> object.</td></tr>
<tr valign="top"><td><code>val.type</code></td>
<td>
character. What type of validation statistic to plot.</td></tr>
<tr valign="top"><td><code>estimate</code></td>
<td>
character. Which estimates of the statistic to
calculate. See <code><a href="MSEP.html">RMSEP</a></code>.</td></tr>
<tr valign="top"><td><code>newdata</code></td>
<td>
data frame. Optional new data used to calculate statistic.</td></tr>
<tr valign="top"><td><code>comps</code></td>
<td>
integer vector. The model sizes to compute the statistic
for. See <code><a href="MSEP.html">RMSEP</a></code>.</td></tr>
<tr valign="top"><td><code>intercept</code></td>
<td>
logical. Whether estimates for a model with zero
components should be calculated as well.</td></tr>
<tr valign="top"><td><code>x</code></td>
<td>
an <code>mvrVal</code> object. Usually the result of a
<code><a href="MSEP.html">RMSEP</a></code>, <code><a href="MSEP.html">MSEP</a></code> or <code><a href="MSEP.html">R2</a></code> call.</td></tr>
<tr valign="top"><td><code>nCols, nRows</code></td>
<td>
integers. The number of coloumns and rows the
plots will be laid out in. If not specified, <code>plot.mvrVal</code> tries
to be intelligent.</td></tr>
<tr valign="top"><td><code>type</code></td>
<td>
character. What type of plots to create. 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. 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> >= 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>...</code></td>
<td>
Further arguments sent to underlying plot functions.</td></tr>
</table>
<h3>Details</h3>
<p>
<code>validationplot</code> calls the proper validation function (currently
<code><a href="MSEP.html">MSEP</a></code>, <code><a href="MSEP.html">RMSEP</a></code> or <code><a href="MSEP.html">R2</a></code>) and plots
the results with <code>plot.mvrVal</code>. <code>validationplot</code> can be
called through the <code>mvr</code> plot method, by specifying
<code>plottype = "validation"</code>.
</p>
<p>
<code>plot.mvrVal</code> creates one plot for each response variable in the
model, laid out in a rectangle. It uses <code><a href="../../graphics/html/matplot.html">matplot</a></code> for
performing the actual plotting. If <code>legendpos</code> is given, a
legend is drawn at the given position.
</p>
<h3>Value</h3>
<p>
If <code>legendpos</code> is given, the functions return whatever
<code>legend</code> returns. Otherwise they do not return any values.</p>
<h3>Note</h3>
<p>
<code><a href="../../graphics/html/legend.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>
<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="MSEP.html">RMSEP</a></code>,
<code><a href="MSEP.html">MSEP</a></code>, <code><a href="MSEP.html">R2</a></code>, <code><a href="../../graphics/html/matplot.html">matplot</a></code>,
<code><a href="../../graphics/html/legend.html">legend</a></code>
</p>
<h3>Examples</h3>
<pre>
data(sensory)
mod <- plsr(Panel ~ Quality, data = sensory, validation = "LOO")
## Not run:
## These three are equivalent:
validationplot(mod, estimate = "all")
plot(mod, "validation", estimate = "all")
plot(RMSEP(mod, estimate = "all"))
## Plot R2:
plot(mod, "validation", val.type = "R2")
## Plot R2, with a legend:
plot(mod, "validation", val.type = "MSEP", legendpos = "top") # R >= 2.1.0
## End(Not run)
</pre>
<hr><div align="center">[Package <em>pls</em> version 1.1-0 <a href="00Index.html">Index]</a></div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -