Description Usage Arguments Value Examples

Multinomial First Differences Predictions For Two Values (Observed Value Approach)

1 2 3 4 5 6 7 8 9 10 11 | ```
mnl_fd2_ova(
model,
data,
x,
value1,
value2,
xvari,
nsim = 1000,
seed = "random",
probs = c(0.025, 0.975)
)
``` |

`model` |
the multinomial model, from a |

`data` |
the data with which the model was estimated |

`x` |
the name of the variable that should be varied |

`value1` |
first value for the difference |

`value2` |
second value for the difference |

`xvari` |
former argument for |

`nsim` |
numbers of simulations |

`seed` |
set a seed for replication purposes. |

`probs` |
a vector with two numbers, defining the significance levels. Default to 5% significance level: |

The function returns a list with several elements. Most importantly the list includes the simulated draws 'S', the simulated predictions 'P', the first differences of the predictions 'P_fd', a data set for plotting 'plotdata' the predicted probabilities, and one for the first differences 'plotdata_fd'.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
library(nnet)
library(MASS)
dataset <- data.frame(y = c(rep("a", 10), rep("b", 10), rep("c", 10)),
x1 = rnorm(30),
x2 = rnorm(30, mean = 1),
x3 = sample(1:10, 30, replace = TRUE))
mod <- multinom(y ~ x1 + x2 + x3, data = dataset, Hess = TRUE)
fdi1 <- mnl_fd2_ova(model = mod, data = dataset,
x = "x1",
value1 = min(dataset$x1),
value2 = max(dataset$x1),
nsim = 10)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.