RankPlot | R Documentation |
RankPlot
creates a figure with a plot of ranking data,
from among several options for showing uncertainty in the ranked estimates.
This function is meant for use within RankPlotWithTable
,
which draws a ranking table aligned with this plot of the data
in one combined figure.
RankPlot( est, se, names, refName = NULL, confLevel = 0.9, plotType = c("individual", "difference", "comparison", "columns"), tiers = 1, GH = FALSE, multcomp.scope = ifelse(plotType == "individual", "none", "demi"), multcomp.type = c("bonferroni", "independence"), tikzText = FALSE, cex = 1, tickWidth = NULL, rangeFactor = 1.2, textPad = 0, legendX = "topleft", legendY = NULL, legendText = NULL, lwdReg = 1, lwdBold = 3, thetaLine = 1, xlim = NULL, Bonferroni )
est, se |
Vectors containing the point estimate and its standard error for each area. |
names |
Vector containing the name of each area. Abbreviations may be preferable to full names (e.g. "CO" instead of "Colorado") since these names will be displayed directly on the plot. |
refName |
String containing the name of the reference area;
must be one of the values in |
confLevel |
Number between 0 and 1: confidence level for individual
(uncorrected) hypothesis tests and/or confidence intervals. E.g. with
|
plotType |
Which type of ranking plot to use. See vignettes for examples and details.
|
tiers |
Numeric, either 1 for usual confidence intervals,
or 2 for two-tiered intervals. 2 can only be used with
|
GH |
Logical, for whether or not to plot adjusted
confidence intervals at an "average" |
multcomp.scope |
Whether to correct for multiple comparisons,
and if so, for how many
(by a correction to the confidence level of the tests or intervals).
|
multcomp.type |
(Only used if |
tikzText |
Logical, for whether or not to format text for tikz plotting. |
cex |
Character expansion factor for the points use to plot each area's point estimate, and for the text used to plot each area's name next to its interval. |
tickWidth |
Numeric height of the cross-bars on interval endpoints
(or inner tiers, if |
rangeFactor |
Numeric multiple by which to expand the range of the data
when setting the x-axis limits. The function tries to leave sufficient room
for plotting margins of error and names next to each area,
but sometimes it may help to adjust |
textPad |
Numeric amount by which to shift the text of |
legendX, legendY |
The x and y co-ordinates used to position the legend;
see |
legendText |
String, or string vector, with legend text. By default,
each plot type adds informative legend text, but the user may override.
To remove legends entirely, set |
lwdReg |
Positive number for the line width of regular lines.
Used for all intervals when |
lwdBold |
Positive number for the line width of bold lines.
Used for intervals significantly different from the reference area
when |
thetaLine |
Number for how many lines below bottom axis to display
"theta" or other default x-axis labels (which depend on |
xlim |
Vector of 2 numbers for x-axis limits. If |
Bonferroni |
Deprecated name for the |
Users may wish to modify this code and write
their own plot function, which can be swapped into figureFunction
within RankPlotWithTable
. Be aware that
RankPlotWithTable
uses layout
to arrange
the table and plot side-by-side, so layout
cannot be used within
a new figureFunction
.
See Goldstein and Healy (1995) for details on the
"average" confidence level procedure used when GH = TRUE
.
See Almond et al. (2000) for details
on the "comparison intervals" procedure.
Almond, R.G., Lewis, C., Tukey, J.W., and Yan, D. (2000). "Displays for Comparing a Given State to Many Others," The American Statistician, vol. 54, no. 2, 89-93.
Goldstein, H. and Healy, M.J.R. (1995). "The Graphical Presentation of a Collection of Means," JRSS A, vol. 158, no. 1, 175-177.
RankPlotWithTable
and RankTable
.
# Plot of 90% confidence intervals for differences # between each state and Colorado, with demi-Bonferroni correction, # for US states' mean travel times to work, from the 2011 ACS data(TravelTime2011) with(TravelTime2011, RankPlot(est = Estimate.2dec, se = SE.2dec, names = Abbreviation, refName = "CO", confLevel = 0.90, cex = 0.6, plotType = "difference"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.