mnlChange.Rd
For objects of class multinom
, it calculates the change in predicted
probabilities, for maximal discrete changes in all covariates holding all
other variables constant at typical values.
mnlChange( obj, data, typical.dat = NULL, diffchange = c("range", "sd", "unit"), sim = TRUE, R = 1500 )
obj | A model object of class |
---|---|
data | Data frame used to fit |
typical.dat | Data frame with a single row containing values at which
to hold variables constant when calculating first differences. These values
will be passed to |
diffchange | A string indicating the difference in predictor values to
calculate the discrete change. |
sim | Logical indicating whether simulated confidence bounds should be produced. |
R | Number of simulations to perform if |
A list with the following elements:
A matrix of calculated first differences
A matrix of values that were used to calculate the predicted changes
A matrix of predicted probabilities when each variable is held at its minimum value, in turn.
A matrix of predicted probabilities when each variable is held at its maximum value, in turn.
The function calculates the changes in predicted probabilities for maximal
discrete changes in the covariates for objects of class multinom
.
This function works with polynomials specified with the poly
function. It also works with multiplicative interactions of the covariates
by virtue of the fact that it holds all other variables at typical values.
By default, typical values are the median for quantitative variables and the
mode for factors. The way the function works with factors is a bit
different. The function identifies the two most different levels of the
factor and calculates the change in predictions for a change from the level
with the smallest prediction to the level with the largest prediction.
#> # 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 #> convergedtypical.france <- data.frame( age = 35, retnat = factor(1, levels=1:3, labels=levels(france$retnat)) ) mnlChange(mnl.mod, data=france, typical.dat=typical.france)#> PCF PS Green RPR UDF #> age -0.031* -0.100 -0.292* 0.275* 0.148* #> male -0.007 -0.067 -0.079 0.050 0.102* #> retnat -0.053* 0.044 -0.069 0.116* -0.037 #> lrself -0.188* -0.755* -0.055* 0.854* 0.144*