coefplot: Plot of the coefficients of a model

Description Usage Arguments Value Examples

View source: R/report_model.R

Description

Creates a plot of the coefficients of a model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
coefplot(
  coefs,
  lwr.int = coefs,
  upper.int = coefs,
  offset = 0,
  coefnames = names(coefs),
  abline.pos = 0,
  sorted = FALSE,
  reverse = FALSE,
  pch = 16,
  xlim = c(min(lwr.int, na.rm = TRUE), max(upper.int, na.rm = TRUE)),
  ylim = c(1, length(coefs)),
  color = "black",
  ...
)

Arguments

coefs

A vector with each coefficient

lwr.int

A vector with the lower end of the CI

upper.int

A vector with the upper end of the CI

offset

Y-axis offset for the coefficients

coefnames

Name for each variable

abline.pos

Position for the vertical reference line

sorted

Should the coefficients be sorted from highest to lowest?

reverse

Should the order be reversed?

pch

Type of point

xlim

Limits of the X-axis

ylim

Limits of the Y-axis

color

Color for the points

...

Further arguments passed to axis()

Value

A plot of the coefficients with their CI

Examples

1
2
3
4
5
6
7
8
9
lm1 <- lm(Petal.Length ~ Sepal.Width + Species, data=iris)
a<-report(lm1)
oldpar <- par()
par(mar=c(4, 10, 3, 2))
#Coefplot calling plot.reportmodel
plot(a)
par(mar=oldpar$mar)  #Restore old margin values
#Manual coefplot
coefplot(coefs=c(1, 2, 3), lwr.int=c(0, 1, 2), upper.int=c(5, 6, 7), coefnames=c("A", "B", "C"))

repmod documentation built on March 22, 2021, 5:08 p.m.

Related to coefplot in repmod...