buildModelCI.default

Share:

Description

Construct Confidence Interval Values

Usage

1
2
3
4
5
6
## Default S3 method:
buildModelCI(model, outerCI = 2, innerCI = 1,
  intercept = TRUE, numeric = FALSE, sort = c("natural", "magnitude",
  "alphabetical"), predictors = NULL, strict = FALSE, coefficients = NULL,
  newNames = NULL, decreasing = TRUE, name = NULL,
  interceptName = "(Intercept)", ...)

Arguments

model

A Fitted model such as from lm, glm

outerCI

How wide the outer confidence interval should be, normally 2 standard deviations. If 0, then there will be no outer confidence interval.

innerCI

How wide the inner confidence interval should be, normally 1 standard deviation. If 0, then there will be no inner confidence interval.

intercept

logical; Whether the Intercept coefficient should be plotted

numeric

logical; If true and factors has exactly one value, then it is displayed in a horizontal graph with constinuous confidence bounds.; not used for now.

sort

Determines the sort order of the coefficients. Possible values are c("natural", "magnitude", "alphabetical")

predictors

A character vector specifying which variables to keep. Each individual variable has to be specfied, so individual levels of factors must be specified. We are working on making this easier to implement, but this is the only option for now.

strict

If TRUE then predictors will only be matched to its own coefficients, not its interactions

coefficients

A character vector specifying which factor variables to keep. It will keep all levels and any interactions, even if those are not listed.

newNames

Named character vector of new names for coefficients

decreasing

logical; Whether the coefficients should be ascending or descending

name

A name for the model, if NULL the call will be used

interceptName

Specifies name of intercept it case it is not the default of "(Intercept").

...

See Details for information on factors, only and shorten

Details

Takes a model and builds a data.frame holding the coefficient value and the confidence interval values.

Value

A data.frame listing coeffcients and confidence bands.

Author(s)

Jared P. Lander

See Also

coefplot multiplot

Examples

1
2
3
4
data(diamonds, package='ggplot2')
model1 <- lm(price ~ carat + cut, data=diamonds)
coefplot:::buildModelCI(model1)
coefplot(model1)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.