Learn R Programming

coefplot (version 1.1.8)

meltModelCI: Melt the modelCI

Description

Melt a modelCI into a form suitable for plotting

Usage

meltModelCI(modelCI,
    keepCols = c("LowOuter", "HighOuter", "LowInner", "HighInner", "Coef", "Checkers", "CoefShort"),
    id.vars = c("CoefShort", "Checkers"),
    variable.name = "Type", value.name = "value",
    outerCols = c("LowOuter", "HighOuter"),
    innerCols = c("LowInner", "HighInner"))

Arguments

modelCI
A data.frame as built by buildModelCI
keepCols
The columns in modelCI that should be kept as there can be extras
id.vars
The columns to use as ID variables in melt
variable.name
Used in melt for naming the column that stores the melted variables
value.name
Used in melt for naming the column that stores the melted values
innerCols
The columns to be included in the data.frame of inner standard errors
outerCols
The columns to be included in the data.frame of outer standard errors

Value

  • A list consisting of
  • modelMeltMelted modelCI with all values
  • modelMeltOutermodelMelt with only values associated with the outer standard errors
  • modelMeltInnermodelMelt with only values associated with the inner standard errors

Details

buildModelCI builds a data.frame for plotting. This function melts it into plottable form and seperates the coefficient data from the SE data into seprate data.frames

See Also

coefplot buildModelCI

Examples

Run this code
data(diamonds)
model1 <- lm(price ~ carat + cut, data=diamonds)
modeled <- coefplot:::buildModelCI(model1)
coefplot:::meltModelCI(modeled)

Run the code above in your browser using DataLab