Wednesday, November 9, 2011

Proc LOGISTIC to fit Multinomial Logistic Models

Multinomial logit model or generalized logit model makes the parameters specific to the nominal. With subject-specific covariate only, the probability of response j=0..J-1 is pi_ij=exp(xi.beta)/(sum_0^(J-1))exp(xi.beta) with beta_0=0 for identification. An intercept is included in each betaj. The multinomial logit model has the property of independence from irrelevant alternatives because pi_jk=exp(xi.(beta_j-beta_k). Having too many parameters is a serious drawback of the MLM.

The multinomial logit model can be estimated in proc logistic and proc glimmix using the link=glogit.

data multinomial_response;
beta1_0 = .2;
beta1_1 = .5;
beta2_0 = -.2;
beta2_1 = .7;
seed = 1234579;
do id = 1 to 500;
x = rannor(seed);
eta1 = beta1_0 + beta1_1*x;
eta2 = beta2_0 + beta2_1*x;
prob1 = exp(eta1) / (1 + exp(eta1) + exp(eta2));
prob2 = exp(eta2) / (1 + exp(eta1) + exp(eta2));
prob3 = 1 / (1 + exp(eta1) + exp(eta2));
call rantbl(seed, prob1, prob2, prob3, y);
output;
end;
keep id x y;
run;

proc logistic data = multinomial_response;
class;
model y = x / link = glogit;
run;

No comments:

Post a Comment

Blog Archive