name wclogit; ?The following is a weighted conditional logit, where data exists on ?48 states (choices), and the number of people who chose each state. ?The data is read in from a separate file, and a single observation ?is created, along with the log likelihood function. ? It is important to use HITER=N,HCOV=N for 2 reasons: ? 1. With HITER=B, the weight (N.) for each state would get squared ? in the Hessian approximation, which is not correct. This applies ? to any weighted log likelihood function. ? 2. With a single observation, HITER=B cannot produce a full rank ? Hessian approximation. FRML WCLOGIT LOGL = NUM - LOG(DENOM); FRML NUM NUM1 + NUM2 + ... + NUM48; ? fill in by hand... FRML DENOM DEN1 + DEN2 + ... + DEN48; ? or use FORM with a COEF of ones EQSUB WCLOGIT NUM DENOM; SMPL 1,1; DOT 1-48; READ(FILE='STATE.DAT') N. X.1 X.2 X.3 ... X.k; ? fill in by hand... FRML FXB X.B = X.1*B1 + X.2*B2 + ... X.k*Bk; ? fill in by hand... or use FORM ? You don't have to name the variables X.1... it could be AGE. INC. etc., ? and the Bs could also be more descriptive. FRML FN NUM. = N.*X.B; FRML FD DEN. = EXP(X.B); EQSUB WCLOGIT FN FD FXB ; ENDDOT; COMPRESS; ? this might be needed PARAM B1-Bk; ?fix by hand ML(HITER=N,HCOV=N) WCLOGIT;