Description Usage Arguments Value

View source: R/multinomial_likelihood.R

Given a dataframe and a formula object, will return the necessary dependent variable matrix and the model matrix needed to run the optimization for multinomial regression for a given reference level.

1 | ```
data_to_mulitnomial(data, formula, ref_level = "8", intercept = T)
``` |

`data` |
a dataframe |

`formula` |
a formula object describing the regression to be run |

`ref_level` |
a string which specifies the reference level of the factor dependent variable |

`intercept` |
logical, whether to include an intercept or not in the regression (default is TRUE) |

a list containing:

An (n x (k-1)) response matrix of 0's and 1's

An (n x p) model matrix where n is the number of observations, p is the number of coefficients in the regression formula, and k is the number of possible levels of the dependent variable y.

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.