broom (version 0.3.7)

multinom_tidiers: Tidying methods for multinomial logistic regression models

Description

These methods tidy the coefficients of multinomial logistic regression models generated by multinom of the nnet package.

Usage

## S3 method for class 'multinom':
tidy(x, conf.int = FALSE, conf.level = 0.95,
  exponentiate = TRUE, ...)

## S3 method for class 'multinom': glance(x, ...)

Arguments

x
A model object of class multinom
conf.int
whether to include a confidence interval
conf.level
confidence level of the interval, used only if conf.int=TRUE
exponentiate
whether to exponentiate the coefficient estimates and confidence intervals (typical for multinomial logistic regression)
...
extra arguments, not used

Value

  • All tidying methods return a data.frame without rownames. The structure depends on the method chosen.

    tidy.multinom returns one row for each coefficient at each level of the response variable, with six columns:

  • y.valueThe response level
  • termThe term in the model being estimated and tested
  • estimateThe estimated coefficient
  • std.errorThe standard error from the linear model
  • statisticWald z-statistic
  • p.valuetwo-sided p-value
  • If conf.int=TRUE, it also includes columns for conf.low and conf.high, computed with confint.

    glance.multinom returns a

    glance.multinom returns a one-row data.frame with the columns

  • edfThe effective degrees of freedom
  • deviancedeviance
  • AICthe Akaike Information Criterion

Details

If conf.int=TRUE, the confidence interval is computed with the confint function.

While tidy and glance are supported for "multinom" objects, augment is not.

Examples

Run this code
if (require(nnet) & require(MASS)){
  example(birthwt)
  bwt.mu <- multinom(low ~ ., bwt)
  tidy(bwt.mu)
  glance(bwt.mu)

  #* This model is a truly terrible model
  #* but it should show you what the output looks
  #* like in a multinomial logistic regression

  fit.gear <- multinom(gear ~ mpg + factor(am), data=mtcars)
  tidy(fit.gear)
  glance(fit.gear)
}

Run the code above in your browser using DataCamp Workspace