## S3 method for class 'lm':
coefplot(model, title = "Coefficient Plot",
xlab = "Value", ylab = "Coefficient", innerCI = 1,
outerCI = 2, lwdInner = 1, lwdOuter = 0,
color = "blue", cex = 0.8, textAngle = 0,
numberAngle = 0, zeroColor = "grey", zeroLWD = 1,
zeroType = 2, facet = FALSE, scales = "free",
sort = c("natural", "normal", "magnitude", "size", "alphabetical"),
decreasing = FALSE, numeric = FALSE,
fillColor = "grey", alpha = 1/2, horizontal = FALSE,
factors = NULL, only = NULL, shorten = TRUE,
intercept = TRUE, plot = TRUE, ...)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 variableplot is TRUE then a ggplot
object is returned. Otherwise a data.frame
listing coeffcients and confidence bands is returned.coefplot is the S3 generic method for
plotting the coefficients from a fitted model.
This method also plots coefficients from glm (using
coefplot.lm) and rxLinMod models (through a redirection
from coefplot.rxLinMod)lm glm ggplot
coefplot plotcoefdata(diamonds)
head(diamonds)
model1 <- lm(price ~ carat + cut*color, data=diamonds)
model2 <- lm(price ~ carat*color, data=diamonds)
coefplot(model1)
coefplot(model1, shorten=FALSE)
coefplot(model1, shorten=c("cut"))
coefplot(model1, shorten=c("cut"), intercept=FALSE)
coefplot(model1, factors="cut")
coefplot(model1, factors="cut", only=TRUE)
coefplot(model1, facet=TRUE)
coefplot(model2)Run the code above in your browser using DataLab