plconfint: Plot Confidence Intervals

plconfintR Documentation

Plot Confidence Intervals

Description

Plot confidence or relevance interval(s) for several samples and for the comparison of two samples, also useful for replications and original studies

Usage

plconfint(x, y = NULL, select=NULL, overlap = NULL, pos = NULL,
  xlim = NULL, refline = 0, add = FALSE, bty = "L", col = NULL,
  plpars=list(lwd=c(2,3,1,4,2), posdiff=0.35,
    markheight=c(1, 0.6, 0.6), extend=NA, reflinecol="gray70"),
  label = TRUE, label2 = NULL, xlab="", ...)

pltwosamples(x, ...)
## Default S3 method:
pltwosamples(x, y = NULL, overlap = TRUE, ...)
## S3 method for class 'formula'
pltwosamples(formula, data = NULL, ...)

Arguments

x

For plconfint: A vector of length >=2 or a matrix with this number of columns, containing

[,1]

the estimate

[,2]

if x is of length 2: width of (symmetric) confidence interval

[,2:3]

if of length >2: the interval end points

[,4:5]

if of length >=5: values for additional ticks on the intervals, typically indicating the end points of a shortened interal, see Details

For pltwosamples: A formula or the data for the first sample – or a list or matrix or data.frame with two components/columns corresponding to the two samples

y

data for a second confidence interval (for plconfint or the second sample (for pltwosamples)

select

selects samples, effects, or studies

overlap

logical: should shortened intervals be shown to show significance of differences? see Details

pos

positions of the bars in vertical direction

xlim

limits for the horizontal axis. NAs will be replaced by the respective element of the range of the x values.

refline

x values for which vertical reference lines are drawn

add

logical: should the plotted elements be added to an existing plot?

bty

type of 'box' around the plot, see par

col

color to be used for the confidence intervals, usually a vector of colors if used.

plpars

graphical options, see Details

label, label2

labels for intervals (or intervall pairs) to be dislayed on the left and right hand margin, respectivly. If label is TRUE, row.names of x are used.

xlab

label for horizontal axis

formula, data

formula and data for the formula method

...

further arguments to the call of plconfint

Details

Columns 4 and 5 of x are typically used to indicate an "overlap interval", which allows for a graphical assessment of the significance of the test for zero difference(s), akin the "notches" in box plots: The difference between a pair of groups is siginificant if their overlap intervals do not overlap. For equal standard errors of the groups, the standard error of the difference between two of them is larger by the factor sqrt(2). Therefore, the intervals should be shortened by this factor, or multiplied by 1/sqrt(2), which is the default for overlapfactor. If only two groups are to be shown, the factor is adjusted to unequal standard errors, and accurate quantiles of a t distribution are used.

The graphical options are:

lwd:

line widths for: [1] the interval, [2] middle mark, [3] end marks, [4] overlap interval marks, [5] vertical line marking the relevance threshold

markheight:

determines the length of the middle mark, the end marks and the marks for the overlap interval as a multiplier of the default length

extend:

extension of the vertical axis beyond the range

reflinecol:

color to be used for the vertical lines at relevances 0 and 1

Value

none

Author(s)

Werner A. Stahel

See Also

plot.inference

Examples

## --- regression
data(swiss)
rr <- lm(Fertility ~ . , data = swiss)
rt <- termtable(rr)
plot(rt)

## --- termeffects
data(d.blast)
rlm <- lm(log10(tremor)~location+log10(distance)+log10(charge), data=d.blast)
rte <- termeffects(rlm)
plot(rte, single=TRUE)

## --- replication
data(d.osc15Onesample)
td <- d.osc15Onesample
tdo <- structure(td[,c(1,2,6)], names=c("effect", "n", "teststatistic"))
tdr <- structure(td[,c(3,4,7)], names=c("effect", "n", "teststatistic"))
rr <- replication(tdo,tdr)

plconfint(attr(rr, "estimate"), refline=c(0,1))

relevance documentation built on Aug. 24, 2023, 3:03 p.m.