Learn R Programming

broom (version 0.4.5)

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 multinom
tidy(x, conf.int = FALSE, conf.level = 0.95,
  exponentiate = TRUE, ...)

# S3 method for 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.value

The response level

term

The term in the model being estimated and tested

estimate

The estimated coefficient

std.error

The standard error from the linear model

statistic

Wald z-statistic

p.value

two-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

edf

The effective degrees of freedom

deviance

deviance

AIC

the 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
# NOT RUN {
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 DataLab