Next: Distributions, Previous: Tests, Up: Statistics

— Functio File: [`theta`, `beta`, `dev`, `dl`, `d2l`, `p`] = **logistic_regression** (`y, x, print, theta, beta`)

Perform ordinal logistic regression.

Suppose

ytakes values inkordered categories, and let`gamma_i (`

x`)`

be the cumulative probability thatyfalls in one of the firsticategories given the covariatex. Then[theta, beta] = logistic_regression (y, x)fits the model

logit (gamma_i (x)) = theta_i - beta' * x, i = 1, ..., k-1The number of ordinal categories,

k, is taken to be the number of distinct values of`round (`

y`)`

. Ifkequals 2,yis binary and the model is ordinary logistic regression. The matrixxis assumed to have full column rank.Given

yonly,`theta = logistic_regression (y)`

fits the model with baseline logit odds only.The full form is

[theta, beta, dev, dl, d2l, gamma] = logistic_regression (y, x, print, theta, beta)in which all output arguments and all input arguments except

yare optional.Stting

thetaandbetagive initial estimates forthetaandbeta.The returned value

devholds minus twice the log-likelihood.The returned values

dlandd2lare the vector of first and the matrix of second derivatives of the log-likelihood with respect tothetaandbeta.

pholds estimates for the conditional distribution ofygivenx.