Learn R Programming

coefplot (version 1.1.8)

buildModelCI: Build data.frame for plotting

Description

Builds a data.frame that is appropriate for plotting coefficients

Usage

buildModelCI(model, outerCI = 2, innerCI = 1,
    intercept = TRUE, numeric = FALSE,
    sort = c("natural", "normal", "magnitude", "size", "alphabetical"),
    decreasing = TRUE, name = NULL, ...)

Arguments

model
The fitted model to build information on
innerCI
How wide the inner confidence interval should be, normally 1 standard deviation. If 0, then there will be no inner confidence interval.
outerCI
How wide the outer confidence interval should be, normally 2 standard deviations. If 0, then there will be no outer confidence interval.
sort
Determines the sort order of the coefficients. Possible values are c("natural", "normal", "magnitude", "size", "alphabetical")
decreasing
logical; Whether the coefficients should be ascending or descending
numeric
logical; If true and factors has exactly one value, then it is displayed in a horizontal graph with constinuous confidence bounds.
intercept
logical; Whether the Intercept coefficient should be plotted
...
See Details for information on factors, only and shorten
name
A name for the model, if NULL the call will be used

Value

  • Otherwise a data.frame listing coeffcients and confidence bands is returned.

Details

This is the workhorse for coefplot, it get's the data all prepared factors Vector of factor variables that will be the only ones shown only logical; If factors has a value this determines how interactions are treated. True means just that variable will be shown and not its interactions. False means interactions will be included. shorten logical or character; If FALSE then coefficients for factor levels will include their variable name. If TRUE coefficients for factor levels will be stripped of their variable names. If a character vector of variables only coefficients for factor levels associated with those variables will the variable names stripped.

See Also

coefplot multiplot

Examples

Run this code
data(diamonds)
model1 <- lm(price ~ carat + cut, data=diamonds)
model2 <- lm(price ~ carat, data=diamonds)
model3 <- lm(price ~ carat + cut + color, data=diamonds)
coefplot:::buildModelCI(model1)
#coefplot(model1)
#coefplot(model2)
#coefplot(model3)
#coefplot(model3, factors="cut")
#coefplot(model3, factors="cut", numeric=T)
#coefplot(model3, shorten="cut")

Run the code above in your browser using DataLab