| Statistics Toolbox™ | ![]() |
PHAT = mnrval(B,X)
YHAT = mnrval(B,X,ssize)
[...,DLO,DHI] = mnrval(B,X,...,stats)
[...] = mnrval(...,param1,val1,param2,val2,...)
PHAT = mnrval(B,X) computes predicted probabilities for the multinomial logistic regression model with predictors X. B contains intercept and coefficient estimates as returned by the mnrfit function. X is an n-by-p matrix of p predictors at each of n observations. PHAT is an n-by-k matrix of predicted probabilities for each multinomial category.
Note mnrval automatically includes a constant term in all models. Do not enter a column of 1s directly into X. |
YHAT = mnrval(B,X,ssize) computes predicted category counts for sample sizes ssize. ssize is an n-by-1 column vector of positive integers.
[...,DLO,DHI] = mnrval(B,X,...,stats) also computes 95% confidence bounds on the predicted probabilities PHAT or counts YHAT. stats is the structure returned by the mnrfit function. DLO and DHI define a lower confidence bound of PHAT or YHAT minus DLO and an upper confidence bound of PHAT or YHAT plus DHI. Confidence bounds are nonsimultaneous and they apply to the fitted curve, not to new observations.
[...] = mnrval(...,param1,val1,param2,val2,...) allows you to specify optional parameter name/value pairs to control the predicted values. These parameters must be set to the corresponding values used with the mnrfit function to compute B. Parameters are:
'model' — The type of model that was fit by mnrfit; one of the text strings 'nominal' (the default), 'ordinal', or 'hierarchical'.
'interactions' — Determines whether the model fit by mnrfit included an interaction between the multinomial categories and the coefficients. The default is 'off' for ordinal models, and 'on' for nominal and hierarchical models.
'link' — The link function that was used by mnrfit for ordinal and hierarchical models. Specify the link parameter value as one of the text strings 'logit'(the default), 'probit', 'comploglog', or 'loglog'. You may not specify the 'link' parameter for nominal models; these always use a multivariate logistic link.
'type' — Set to 'category' (the default) to return predictions and confidence bounds for the probabilities (or counts) of the k multinomial categories. Set to 'cumulative' to return predictions and confidence bounds for the cumulative probabilities (or counts) of the first k–1 multinomial categories, as an n-by-(k–1) matrix. The predicted cumulative probability for the kth category is 1. Set to 'conditional' to return predictions and confidence bounds in terms of the first k–1 conditional category probabilities, i.e., the probability for category j, given an outcome in category j or higher. When 'type' is 'conditional', and you supply the sample size argument ssize, the predicted counts at each row of X are conditioned on the corresponding element of ssize, across all categories.
'confidence' — The confidence level for the confidence bounds; a value between 0 and 1. The default is 0.95.
[1] McCullagh, P., and J. A. Nelder. Generalized Linear Models. New York: Chapman & Hall, 1990.
![]() | mnrnd | moment | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |