R: Average Effects for Multinomial Logistic Regression Models
mnlChange2
R Documentation
Average Effects for Multinomial Logistic Regression Models
Description
Calculates average effects of a variable in multinomial logistic regression holding all other variables at observed values.
Usage
mnlChange2(obj, varname, data, change = c("unit", "sd"), R = 1500)
Arguments
obj
An object of class multinom
varname
A string identifying the variable to be manipulated.
data
Data frame used to fit object.
change
A string indicating the difference in predictor values to calculate the discrete change. sd gives plus and minus one-half standard deviation change around the median and unit gives a plus and minus one-half unit change around the median.
R
Number of simulations.
Value
A list with elements:
mean
Average effect of the variable for each category of the dependent variable.
lower
Lower 95 percent confidence bound
upper
Upper 95 percent confidence bound
Author(s)
Dave Armstrong (UW-Milwaukee, Department of Political Science)
Examples
library(nnet)
data(france)
mnl.mod <- multinom(vote ~ age + male + retnat + lrself, data=france)
mnlChange2(mnl.mod, "lrself", data=france, )
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DAMisc)
Loading required package: car
Loading required package: effects
Attaching package: 'effects'
The following object is masked from 'package:car':
Prestige
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DAMisc/mnlChange2.Rd_%03d_medium.png", width=480, height=480)
> ### Name: mnlChange2
> ### Title: Average Effects for Multinomial Logistic Regression Models
> ### Aliases: mnlChange2
>
> ### ** Examples
>
> library(nnet)
> data(france)
> mnl.mod <- multinom(vote ~ age + male + retnat + lrself, data=france)
# weights: 35 (24 variable)
initial value 872.315349
iter 10 value 655.272636
iter 20 value 559.902797
iter 30 value 551.176433
final value 551.169697
converged
> mnlChange2(mnl.mod, "lrself", data=france, )
$mean
lrself
PCF 0.046270032
PS 0.091429844
Green -0.001599002
RPR -0.078909980
UDF -0.057272165
$lower
lrself
PCF 0.03184023
PS 0.07502256
Green -0.01030989
RPR -0.08960933
UDF -0.06920504
$upper
lrself
PCF 0.060786815
PS 0.107269119
Green 0.007797836
RPR -0.067364659
UDF -0.046332067
>
>
>
>
>
>
>
> dev.off()
null device
1
>