plotCI: Plot Confidence Intervals

View source: R/BranchGLMCIs.R

plotCIR Documentation

Plot Confidence Intervals

Description

Plot Confidence Intervals

Usage

plotCI(
  CIs,
  points = NULL,
  ylab = "",
  las = 2,
  cex.y = 1,
  decreasing = FALSE,
  ...
)

Arguments

CIs

a matrix of confidence intervals, must have either 2 rows or 2 columns. The variable names displayed in the plot are taken from either the column names or row names of this.

points

points to be plotted in the middle of the CIs, typically means or medians. The default is to plot the midpoint of the intervals.

ylab

axis label for y-axis.

las

the style of the y-axis label, the default is horizontal, see more about this at par.

cex.y

font size used for variable names on y-axis.

decreasing

a logical value indicating if confidence intervals should be displayed in decreasing or increasing order according to points. Can use NA if no ordering is desired.

...

further arguments passed to default plot method.

Value

This only produces a plot, nothing is returned.

Examples

Data <- iris
### Fitting linear regression model
mymodel <- BranchGLM(Sepal.Length ~ ., data = Data, family = "gaussian", link = "identity")

### Getting confidence intervals
CIs <- confint.default(mymodel, level = 0.95)
xlim <- c(min(CIs), max(CIs))

### Plotting CIs
par(mar = c(5, 7, 3, 1) + 0.1)
plotCI(CIs, main = "95% Confidence Intervals", xlim = xlim, cex.y = 0.9, 
xlab = "Beta Coefficients")
abline(v = 0)


BranchGLM documentation built on Aug. 31, 2023, 5:17 p.m.