Description Usage Arguments Value Examples

View source: R/estimation_support.R

Function to generate random responses given parameter values and a design matrix, assuming a MNL model.

1 | ```
RespondMNL(par, des, n.alts, bin = TRUE)
``` |

`par` |
Numeric vector containing parameter values. |

`des` |
A design matrix in which each row is a profile. If alternative
specific constants are present, those should be included as the first
column(s) of the design. Can be generated with |

`n.alts` |
Numeric value indicating the number of alternatives per choice set. |

`bin` |
A logical value indicating whether the returned value should be a binary vector or a discrete value which denotes the chosen alternative. |

Numeric vector indicating the chosen alternatives.

1 2 3 4 5 | ```
# design: 3 dummy coded attributes, each 3 levels. There are 8 choice sets.
des <- example_design
set.seed(123)
true_par <- rnorm(6)
RespondMNL(par = true_par, des = des, n.alts = 2)
``` |

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.