Description Usage Arguments Details Value Author(s) See Also Examples

Using a formula and data, create a specification object of a multinomial logit model.

1 2 |

`f` |
Formula (see Details below). |

`data` |
Data frame containing the variables in the model. It should be in the ‘wide’ format (using the terminology of the |

`choices` |
Vector of names of alternatives. If it is not given, it is determined from the response column of the data frame. Values of this vector should match or be a subset of those in the response column. |

`base.choice` |
Index of the base alternative within the vector |

`varying` |
Indices of variables within |

`sep` |
Separator of variable name and alternative name in the ‘varying’ variables. |

The formula `f`

is of the form `response ~ x1 + x2 | y1 + y2`

. Coefficients for variables in the first part of the formula (i.e. before '|'), here `x1`

and `x2`

, are forced to be the same for all alternatives. Variables in the second part of the formula (i.e. after '|'), here `y1`

and `y2`

, have different coefficients for different alternatives. Either part of the formula can be omitted. Alternative specific constants (asc) are included automatically. To exclude asc, use -1 in the first part. The equation of the base alternative is always set to 0.

An object of class `mnl.spec`

containing the following elements:

`response` |
Name of the response variable. |

`choices` |
Vector of alternatives. |

`base.choice` |
Index of the base alternative within |

`variable.used` |
Matrix of size number of choices x number of variables. Each value is logical determining if the variable is used in that choice equation. |

`same.coefs` |
Logical vector of size number of variables. It determines if that variable has the same coefficient for all alternatives. |

`full.var.names` |
Matrix of the same shape as |

`varying.names` |
Vector of variable names specified by the |

`intercepts` |
Logical vector of size number of choices determining in which equation asc is used. |

`sep` |
Separator of variable name and alternative name in the ‘varying’ variables. |

`frequency` |
Table of frequencies for each choice in the |

Hana Sevcikova

1 2 3 4 5 |

```
Loading required package: BMA
Loading required package: survival
Loading required package: leaps
Loading required package: robustbase
Attaching package: 'robustbase'
The following object is masked from 'package:survival':
heart
Loading required package: inline
Loading required package: rrcov
Scalable Robust Estimators with High Breakdown Point (version 1.4-4)
Loading required package: abind
Loading required package: maxLik
Loading required package: miscTools
Attaching package: 'miscTools'
The following objects are masked from 'package:robustbase':
colMedians, rowMedians
Please cite the 'maxLik' package as:
Henningsen, Arne and Toomet, Ott (2011). maxLik: A package for maximum likelihood estimation in R. Computational Statistics 26(3), 443-458. DOI 10.1007/s00180-010-0217-1.
If you have questions, suggestions, or comments regarding the 'maxLik' package, please use a forum or 'tracker' at maxLik's R-Forge site:
https://r-forge.r-project.org/projects/maxlik/
Response variable: depvar
Base choice name: 1
Base choice index: 1
Frequency of alternatives:
1 4 2 5 3
573 84 129 50 64
Equations:
----------
alternative intercept 1 2 3
1 1:
2 4: asc4 + income + ic + oc
3 2: asc2 + income + ic + oc
4 5: asc5 + income + ic + oc
5 3: asc3 + income + ic + oc
Response variable: depvar
Base choice name: 1
Base choice index: 1
Frequency of alternatives:
1 4 2 5 3
573 84 129 50 64
Equations:
----------
alternative intercept 1 2
1 1:
2 4: ic4 + oc
3 2: ic2 + oc
4 5: ic5 + oc
5 3: ic3 + oc
```

mlogitBMA documentation built on May 30, 2017, 2:51 a.m.

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.