This is the panel function for Xpose 4. This is not intended to be
ised outside the xpose.plot.default
function. Most of the
arguments take their default values from xpose.data object but this
can be overridden by supplying them as argument to xpose.plot.default
.
xpose.panel.default(x, y,object,
subscripts,
groups = object@Prefs@Xvardef$id,
grp.col = NULL,
iplot = NULL,
inclZeroWRES = FALSE,
onlyfirst = FALSE,
samp = NULL,
xvarnam = NULL,
yvarnam = NULL,
###############################
## Prediction interval settings
###############################
PI = NULL,
PI.subset=NULL,
PI.bin.table=NULL,
PI.real=NULL, # can be NULL/TRUE
PI.mirror=NULL,
PI.ci = NULL,
PPI = NULL,
PI.mean = FALSE, # Should the mean be plotted in the VPCs
PI.delta.mean = FALSE, # Should the delta.mean be plotted in the VPCs
PI.limits= c(0.025, 0.975),#object@Prefs@Graph.prefs$PI.limits, PI.arcol = "lightgreen",#object@Prefs@Graph.prefs$PI.arcol,
PI.up.lty = 2,#object@Prefs@Graph.prefs$PI.up.lty,
PI.up.type = "l",#object@Prefs@Graph.prefs$PI.up.type,
PI.up.col = "black",#object@Prefs@Graph.prefs$PI.up.col,
PI.up.lwd = 2,#object@Prefs@Graph.prefs$PI.up.lwd,
PI.down.lty = 2,#object@Prefs@Graph.prefs$PI.down.lty,
PI.down.type = "l",#object@Prefs@Graph.prefs$PI.down.type,
PI.down.col = "black",#object@Prefs@Graph.prefs$PI.down.col,
PI.down.lwd = 2,#object@Prefs@Graph.prefs$PI.down.lwd,
PI.med.lty = 1,#object@Prefs@Graph.prefs$PI.med.lty,
PI.med.type = "l",#object@Prefs@Graph.prefs$PI.med.type,
PI.med.col = "black",#object@Prefs@Graph.prefs$PI.med.col,
PI.med.lwd = 2,#object@Prefs@Graph.prefs$PI.med.lwd,
PI.mean.lty = 3,#object@Prefs@Graph.prefs$PI.med.lty,
PI.mean.type = "l",#object@Prefs@Graph.prefs$PI.med.type,
PI.mean.col = "black",#object@Prefs@Graph.prefs$PI.med.col,
PI.mean.lwd = 2,#object@Prefs@Graph.prefs$PI.med.lwd,
PI.delta.mean.lty = 3,#object@Prefs@Graph.prefs$PI.med.lty,
PI.delta.mean.type = "l",#object@Prefs@Graph.prefs$PI.med.type,
PI.delta.mean.col = "black",#object@Prefs@Graph.prefs$PI.med.col,
PI.delta.mean.lwd = 2,#object@Prefs@Graph.prefs$PI.med.lwd,
PI.real.up.lty = 2,#object@Prefs@Graph.prefs$PI.real.up.lty,
PI.real.up.type = "l",#object@Prefs@Graph.prefs$PI.real.up.type,
PI.real.up.col = "red",#object@Prefs@Graph.prefs$PI.real.up.col,
PI.real.up.lwd = 2,#object@Prefs@Graph.prefs$PI.real.up.lwd,
PI.real.down.lty = 2,#object@Prefs@Graph.prefs$PI.real.down.lty,
PI.real.down.type = "l",#object@Prefs@Graph.prefs$PI.real.down.type,
PI.real.down.col = "red",#object@Prefs@Graph.prefs$PI.real.down.col,
PI.real.down.lwd = 2,#object@Prefs@Graph.prefs$PI.real.down.lwd,
PI.real.med.lty = 1,#object@Prefs@Graph.prefs$PI.real.med.lty,
PI.real.med.type = "l",#object@Prefs@Graph.prefs$PI.real.med.type,
PI.real.med.col = "red",#object@Prefs@Graph.prefs$PI.real.med.col,
PI.real.med.lwd = 2,#object@Prefs@Graph.prefs$PI.real.med.lwd,
PI.real.mean.lty = 3,#object@Prefs@Graph.prefs$PI.real.med.lty,
PI.real.mean.type = "l",#object@Prefs@Graph.prefs$PI.real.med.type,
PI.real.mean.col = "red",#object@Prefs@Graph.prefs$PI.real.med.col,
PI.real.mean.lwd = 2,#object@Prefs@Graph.prefs$PI.real.med.lwd,
PI.real.delta.mean.lty = 3,#object@Prefs@Graph.prefs$PI.real.med.lty,
PI.real.delta.mean.type = "l",#object@Prefs@Graph.prefs$PI.real.med.type,
PI.real.delta.mean.col = "red",#object@Prefs@Graph.prefs$PI.real.med.col,
PI.real.delta.mean.lwd = 2,#object@Prefs@Graph.prefs$PI.real.med.lwd,
PI.mirror.up.lty = 2,#object@Prefs@Graph.prefs$PI.mirror.up.lty,
PI.mirror.up.type = "l",#object@Prefs@Graph.prefs$PI.mirror.up.type,
PI.mirror.up.col = "darkgreen",#object@Prefs@Graph.prefs$PI.mirror.up.col,
PI.mirror.up.lwd = 1,#object@Prefs@Graph.prefs$PI.mirror.up.lwd,
PI.mirror.down.lty = 2,#object@Prefs@Graph.prefs$PI.mirror.down.lty,
PI.mirror.down.type = "l",#object@Prefs@Graph.prefs$PI.mirror.down.type,
PI.mirror.down.col = "darkgreen",#object@Prefs@Graph.prefs$PI.mirror.down.col,
PI.mirror.down.lwd = 1,#object@Prefs@Graph.prefs$PI.mirror.down.lwd,
PI.mirror.med.lty = 1,#object@Prefs@Graph.prefs$PI.mirror.med.lty,
PI.mirror.med.type = "l",#object@Prefs@Graph.prefs$PI.mirror.med.type,
PI.mirror.med.col = "darkgreen",#object@Prefs@Graph.prefs$PI.mirror.med.col,
PI.mirror.med.lwd = 1,#object@Prefs@Graph.prefs$PI.mirror.med.lwd,
PI.mirror.mean.lty = 3,#object@Prefs@Graph.prefs$PI.mirror.med.lty,
PI.mirror.mean.type = "l",#object@Prefs@Graph.prefs$PI.mirror.med.type,
PI.mirror.mean.col = "darkgreen",#object@Prefs@Graph.prefs$PI.mirror.med.col,
PI.mirror.mean.lwd = 1,#object@Prefs@Graph.prefs$PI.mirror.med.lwd,
PI.mirror.delta.mean.lty = 3,#object@Prefs@Graph.prefs$PI.mirror.med.lty,
PI.mirror.delta.mean.type = "l",#object@Prefs@Graph.prefs$PI.mirror.med.type,
PI.mirror.delta.mean.col = "darkgreen",
PI.mirror.delta.mean.lwd = 1,#object@Prefs@Graph.prefs$PI.mirror.med.lwd,
PI.ci.up.arcol = "blue",
PI.ci.up.lty = 3,#object@Prefs@Graph.prefs$PIuplty,
PI.ci.up.type = "l",#object@Prefs@Graph.prefs$PIuptyp,
PI.ci.up.col = "darkorange",#object@Prefs@Graph.prefs$PI.up.col,
PI.ci.up.lwd = 2,#object@Prefs@Graph.prefs$PI.up.lwd,
PI.ci.down.arcol = "blue",
PI.ci.down.lty = 3,#object@Prefs@Graph.prefs$PIdolty,
PI.ci.down.type = "l",#object@Prefs@Graph.prefs$PIdotyp,
PI.ci.down.col = "darkorange",#object@Prefs@Graph.prefs$PI.down.col,
PI.ci.down.lwd = 2,#object@Prefs@Graph.prefs$PI.down.lwd,
PI.ci.med.arcol = "blue",
PI.ci.med.lty = 4,#object@Prefs@Graph.prefs$PImelty,
PI.ci.med.type = "l",#object@Prefs@Graph.prefs$PImetyp,
PI.ci.med.col = "darkorange",#object@Prefs@Graph.prefs$PI.med.col,
PI.ci.med.lwd = 2,#object@Prefs@Graph.prefs$PI.med.lwd,
PI.ci.mean.arcol = "purple",
PI.ci.mean.lty = 4,#object@Prefs@Graph.prefs$PImelty,
PI.ci.mean.type = "l",#object@Prefs@Graph.prefs$PImetyp,
PI.ci.mean.col = "darkorange",#object@Prefs@Graph.prefs$PI.med.col,
PI.ci.mean.lwd = 2,#object@Prefs@Graph.prefs$PI.med.lwd,
PI.ci.delta.mean.arcol = "purple",
PI.ci.delta.mean.lty = 4,#object@Prefs@Graph.prefs$PImelty,
PI.ci.delta.mean.type = "l",#object@Prefs@Graph.prefs$PImetyp,
PI.ci.delta.mean.col = "darkorange",#object@Prefs@Graph.prefs$PI.med.col,
PI.ci.delta.mean.lwd = 2,#object@Prefs@Graph.prefs$PI.med.lwd,
PI.ci.area.smooth=FALSE,
###############################
## end of PI settings
###############################
## Basic plot characteristics
type = object@Prefs@Graph.prefs$type,
col = object@Prefs@Graph.prefs$col,
pch = object@Prefs@Graph.prefs$pch,
cex = object@Prefs@Graph.prefs$cex,
lty = object@Prefs@Graph.prefs$lty,
lwd = object@Prefs@Graph.prefs$lwd,
fill = object@Prefs@Graph.prefs$fill,
## Text label setting
ids = NULL,
idsmode=object@Prefs@Graph.prefs$idsmode,
idsext =object@Prefs@Graph.prefs$idsext,
idscex= object@Prefs@Graph.prefs$idscex,
idsdir= object@Prefs@Graph.prefs$idsdir,
## abline settings
abline= object@Prefs@Graph.prefs$abline,
abllwd= object@Prefs@Graph.prefs$abllwd,
abllty= object@Prefs@Graph.prefs$abllty,
ablcol= object@Prefs@Graph.prefs$ablcol,
smooth= object@Prefs@Graph.prefs$smooth,
smlwd = object@Prefs@Graph.prefs$smlwd,
smlty = object@Prefs@Graph.prefs$smlty,
smcol = object@Prefs@Graph.prefs$smcol,
smspan= object@Prefs@Graph.prefs$smspan,
smdegr= object@Prefs@Graph.prefs$smdegr,
smooth.for.groups=NULL,
lmline= object@Prefs@Graph.prefs$lmline,
lmlwd = object@Prefs@Graph.prefs$lmlwd ,
lmlty = object@Prefs@Graph.prefs$lmlty ,
lmcol = object@Prefs@Graph.prefs$lmcol ,
suline = object@Prefs@Graph.prefs$suline,
sulwd = object@Prefs@Graph.prefs$sulwd ,
sulty = object@Prefs@Graph.prefs$sulty ,
sucol = object@Prefs@Graph.prefs$sucol ,
suspan = object@Prefs@Graph.prefs$suspan,
sudegr = object@Prefs@Graph.prefs$sudegr,
## Layout parameters
grid = object@Prefs@Graph.prefs$grid,
logy = FALSE,
logx = FALSE,
## Force x variables to be continuous
force.x.continuous = FALSE,
## Categorcal x-variable
bwhoriz = object@Prefs@Graph.prefs$bwhoriz,
bwratio = object@Prefs@Graph.prefs$bwratio,
bwvarwid = object@Prefs@Graph.prefs$bwvarwid,
bwdotpch = object@Prefs@Graph.prefs$bwdotpch,
bwdotcol = object@Prefs@Graph.prefs$bwdotcol,
bwdotcex = object@Prefs@Graph.prefs$bwdotcex,
bwreccol = object@Prefs@Graph.prefs$bwreccol,
bwrecfill= object@Prefs@Graph.prefs$bwrecfill,
bwreclty = object@Prefs@Graph.prefs$bwreclty,
bwreclwd = object@Prefs@Graph.prefs$bwreclwd,
bwumbcol = object@Prefs@Graph.prefs$bwumbcol,
bwumblty = object@Prefs@Graph.prefs$bwumblty,
bwumblwd = object@Prefs@Graph.prefs$bwumblwd,
bwoutcol = object@Prefs@Graph.prefs$bwoutcol,
bwoutcex = object@Prefs@Graph.prefs$bwoutcex,
bwoutpch = object@Prefs@Graph.prefs$bwoutpch,
autocorr=FALSE,
## vline settings
vline= NULL,#object@Prefs@Graph.prefs$abline,
vllwd= 3,#object@Prefs@Graph.prefs$abllwd,
vllty= 2,#object@Prefs@Graph.prefs$abllty,
vlcol= "grey",#object@Prefs@Graph.prefs$ablcol,
## hline settings
hline= NULL,#object@Prefs@Graph.prefs$abline,
hllwd= 3,#object@Prefs@Graph.prefs$abllwd,
hllty= 1,#object@Prefs@Graph.prefs$abllty,
hlcol= "grey",#object@Prefs@Graph.prefs$ablcol,
# ind.plots/group panels with single point per panel/group
pch.ip.sp=pch,
cex.ip.sp=cex,
...)
Name(s) of the x-variable.
Name(s) of the y-variable.
An xpose.data object.
The standard Trellis subscripts argument (see
xyplot
)
Name of the variable used for superpose plots.
Logical value indicating whether or not to use colour highlighting when groups are specified. NULL means no highlighting, while TRUE will identify group members by colour.
Is this an indvidual plots matrix? Internal use only.
Logical value indicating whether rows with WRES=0 is included in the plot.
Logical value indicating whether only the first row per individual is included in teh plot.
An integer between 1 and object@Nsim
(seexpose.data-class
) specifying which of the
simulated data sets to extract from SData.
Character string with the name of the x-variable.
Character string with the name of the y-variable.
1-character string giving the type of plot desired. The following values are possible, for details, see 'plot': '"p"' for points, '"l"' for lines, '"o"' for overplotted points and lines, '"b"', '"c"') for (empty if '"c"') points joined by lines, '"s"' and '"S"' for stair steps and '"h"' for histogram-like vertical lines. Finally, '"n"' does not produce any points or lines.
The color for lines and points. Specified as an integer or
a text string. A full list is obtained by the R command
colours()
. The default is blue (col=4).
The plotting character, or symbol, to use. Specified as an
integer. See R help on points
. The default is an open circle.
The amount by which plotting text and symbols should be scaled relative to the default. 'NULL' and 'NA' are equivalent to '1.0'.
The line type. Line types can either be specified as an integer (0=blank, 1=solid, 2=dashed, 3=dotted, 4=dotdash, 5=longdash, 6=twodash) or as one of the character strings '"blank"', '"solid"', '"dashed"', '"dotted"', '"dotdash"', '"longdash"', or '"twodash"', where '"blank"' uses 'invisible lines' (i.e., doesn't draw them).
the width for lines. Specified as an integer. The default is 1.
fill for areas in plot
Logical value specifying whether to label data points.
Determines the way text labels are added to
plots. NULL
means that only extreme points are
labelled. Non-NULL
means all data points are labelled. (See
link{xpose.plot.default}
)
specifies the extent of the extremes to be used in labelling points. The default is 0.05 (only the most extreme 5% of points are labelled).
the amount by which labels should be scaled relative to the default. 'NULL' and 'NA' are equivalent to '1.0'.
a string indicating the directions of the extremes to include in labelling. Possible values are "up", "down" and "both".
Vector of arguments to the panel.abline
function. No abline is drawn if NULL
.
Line width of any abline.
Line type of any abline.
Line colour of any abline.
logical variable specifying whether a linear regression line should
be superimposed over an xyplot
. NULL
~ FALSE. (y~x
)
Line width of the lmline.
Line type of the lmline.
Line colour of the lmline.
A NULL
value indicates that no superposed line
should be added to the graph. If TRUE
then a smooth of the data will
be superimposed.
Line width of the x-y smooth.
Line type of the x-y smooth.
Line color of the x-y smooth.
The smoothness parameter for the x-y smooth. The default is 0.667. An argument
to panel.loess
.
The degree of the polynomials to be used for the x-y smooth, up to 2. The default
is 1. An argument to panel.loess
.
Should a smooth for each group be drawn?
A NULL
value indicates that no superposed line
should be added to the graph. If non-NULL
then this should be
the vector (the same length as y) of data points to be used for the smoothed
superposed line.
Line width of the superposed smooth.
Line type of the superposed smooth.
Line color of the superposed smooth.
The smoothness parameter. The default is 0.667. An argument
to panel.loess
.
The degree of the polynomials to be used, up to 2. The default
is 1. An argument to panel.loess
.
logical value indicating whether a visual reference grid should be added to the graph. (Could use arguments for line type, color etc).
Logical value indicating whether the y-axis should be logarithmic.
Logical value indicating whether the y-axis should be logarithmic.
Logical value indicating whether x-values should be taken as continuous, even if categorical.
logical value indicating whether box and whiskers should be horizontal or not. The default is FALSE.
Ratio of box height to inter-box space. The default is 1.5.
An argument for panel.bwplot
.
Logical. If TRUE, widths of boxplots are proportional to the
number of points used in creating it. The default is FALSE. An argument
for panel.bwplot
.
Graphical parameter controlling the dot plotting character
in boxplots. 'bwdotpch="|"' is treated specially, by replacing
the dot with a line. The default is 16. An argument for panel.bwplot
.
Graphical parameter controlling the dot colour in boxplots - an integer or
string. See 'col'. The default is black. An argument for panel.bwplot
.
The amount by which plotting text and symbols should be scaled
relative to the default in boxplots. 'NULL' and 'NA' are equivalent to '1.0'. An argument
for panel.bwplot
.
The colour to use for the box rectangle in boxplots - an integer or string.
The default is blue. See trellis.par.get
and "box.rectangle".
The colour to use for filling the box rectangle in boxplots - an integer
or string. The default is transparent (none). See trellis.par.get
and "box.rectangle".
The line type for the box rectangle in boxplots - an integer or string.
The default is solid. See trellis.par.get
and "box.rectangle".
The width of the lines for the box rectangle in boxplots - an integer. The
default is 1. See trellis.par.get
and "box.rectangle".
The colour to use for the umbrellas in boxplots - an integer or string.
The default is blue. See trellis.par.get
and "box.umbrella".
The line type for the umbrellas in boxplots - an integer or string. The
default is solid.See trellis.par.get
and "box.umbrella".
the width of the lines for the umbrellas in boxplots - an integer. The
default is 1. See trellis.par.get
and "box.umbrella".
The colour to use for the outliers in boxplots - an integer or string.
The default is blue. See trellis.par.get
and "box.symbol".
The amount by which outlier points should be scaled relative
to the default in boxplots. 'NULL' and 'NA' are equivalent to '1.0'. The default
is 0.8. See trellis.par.get
and "box.symbol".
The plotting character, or symbol, to use for outlier points in boxplots.
Specified as an integer. See R help on 'points'. The default is an open
circle. See trellis.par.get
and "box.symbol".
Either "lines", "area" or "both" specifying whether
prediction intervals (as lines, as a shaded area or both)
should be computed from the data in SData
and added to the
display. NULL
means no prediction interval.
The subset to be used for the PI.
The table used to create VPC plots. Has a
specific format created by read.npc.vpc.results
Plot the percentiles of the real data in the various bins. values can be NULL or TRUE. Note that for a bin with few actual observations the percentiles will be approximate. For example, the 95th percentile of 4 data points will always be the largest of the 4 data points.
Plot the
percentiles of one simulated data set in each bin. values allowed
are NULL
, TRUE
or
AN.INTEGER.VALUE
.
TRUE
takes the first mirror from PI.bin.table
and
AN.INTEGER.VALUE
can be 1, 2, … n
where n
is the number of mirror's output in the PI.bin.table
. Used
mainly by xpose.VPC
.
Plot the prediction
interval of the simulated data's percentiles for each bin. Values
can be "both", "area" or "lines"
This
can be thought of as a prediction interval about the
PI.real
or a confidence interval about the PI
.
However, note that with increasing number of simulations the CI
will not go towards zero because the interval is also
dependent on the size of the data set.
The plot prediction interval. Has a specific format that
must be followed. See setup.PPI
.
Should the mean be plotted in the VPCs? TRUE or FALSE.
Should the delta mean be plotted in the VPCs? TRUE or FALSE.
A vector of two values
that describe the limits of the prediction interval that should be
displayed. For example c(0.025, 0.975)
. These limits should
be found in the
PI.bin.table
table. These limits are also used
as the percentages for the PI.real, PI.mirror
and
PI.ci
. However, the confidence interval in PI.ci
is
always the one defined in the PI.bin.table
.
The color of the PI
area
The upper line type. can be "dotted" or "dashed", etc.
The upper type used for plotting. Defaults to a line.
The upper line color
The upper line width
The lower line type. can be "dotted" or "dashed", etc.
The lower type used for plotting. Defaults to a line.
The lower line color
The lower line width
The median line type. can be "dotted" or "dashed", etc.
The median type used for plotting. Defaults to a line.
The median line color
The median line width
The mean line type. can be "dotted" or "dashed", etc.
The mean type used for plotting. Defaults to a line.
The mean line color
The mean line width
The delta.mean line type. can be "dotted" or "dashed", etc.
The delta.mean type used for plotting. Defaults to a line.
The delta.mean line color
The delta.mean line width
The color of the upper
PI.ci
.
The color of the median
PI.ci
.
The color of the lower
PI.ci
.
The upper line type. can be "dotted" or "dashed", etc.
The upper type used for plotting. Defaults to a line.
The upper line color
The upper line width
The lower line type. can be "dotted" or "dashed", etc.
The lower type used for plotting. Defaults to a line.
The lower line color
The lower line width
The median line type. can be "dotted" or "dashed", etc.
The median type used for plotting. Defaults to a line.
The median line color
The median line width
The color of the mean
PI.ci
.
The mean line type. can be "dotted" or "dashed", etc.
The mean type used for plotting. Defaults to a line.
The mean line color
The mean line width
The color of the delta.mean
PI.ci
.
The delta.mean line type. can be "dotted" or "dashed", etc.
The delta.mean type used for plotting. Defaults to a line.
The delta.mean line color
The delta.mean line width
The upper line type. can be "dotted" or "dashed", etc.
The upper type used for plotting. Defaults to a line.
The upper line color
The upper line width
The lower line type. can be "dotted" or "dashed", etc.
The lower type used for plotting. Defaults to a line.
The lower line color
The lower line width
The median line type. can be "dotted" or "dashed", etc.
The median type used for plotting. Defaults to a line.
The median line color
The median line width
The mean line type. can be "dotted" or "dashed", etc.
The mean type used for plotting. Defaults to a line.
The mean line color
The mean line width
The delta.mean line type. can be "dotted" or "dashed", etc.
The delta.mean type used for plotting. Defaults to a line.
The delta.mean line color
The delta.mean line width
The upper line type. can be "dotted" or "dashed", etc.
The upper type used for plotting. Defaults to a line.
The upper line color
The upper line width
The lower line type. can be "dotted" or "dashed", etc.
The lower type used for plotting. Defaults to a line.
The lower line color
The lower line width
The median line type. can be "dotted" or "dashed", etc.
The median type used for plotting. Defaults to a line.
The median line color
The median line width
The mean line type. can be "dotted" or "dashed", etc.
The mean type used for plotting. Defaults to a line.
The mean line color
The mean line width
The delta.mean line type. can be "dotted" or "dashed", etc.
The delta.mean type used for plotting. Defaults to a line.
The delta.mean line color
The delta.mean line width
Should the "area" for PI.ci
be
smoothed to match the "lines" argument? Allowed values are
TRUE/FALSE
. The "area" is set by
default to show
the bins used in the PI.ci
computation. By smoothing,
information is lost and, in general, the confidence intervals will
be smaller than they are in reality.
Is this an autocorrelation plot? Values can be
TRUE/FALSE
.
Add a vertical line to the plot at the values specified.
Width (lwd) of vertical line
Line type (lty) for vertical line
Color (col) of vertical line
Add a horizontal line to the plot at the values specified.
Width (lwd) of horizontal line
Line type (lty) for horizontal line
Color (col) of horizontal line
If there is a panel with just one observation then this specifies the type of points for the DV, IPRED and PRED respectively.
If there is a panel with just one observation then this specifies the size of the points for the DV, IPRED and PRED respectively.
Other arguments that may be needed in the function.
xpose.data-class
, Cross-references above.