version 10.0 set more off #delimit; * Load dataset into Stata *************************; use dutch271cond.dta, clear; * vote takes the values 1 to 4, as in codebook - note that each obs is in * the data set 4 times! WHY? * here are some case specific variables:; list respid choice inc relig in 1/16, sep(4); * and here are some alternative specific variables:; list respid choice disabor disnuke disinc disleft disleft in 1/16, sep(4); * Now we want to estimate a model which only includes case specific variables. * This essentially is a multinomial logit model but specified as conditional * choice model *****************************************************************************; * There are two methods: - we can either use "clogit" together with choice specific dummies and interactions between choices and case specific variables, - or we can use Stata 10's new "asclogit" command which allows to specify everything in one command line. We will do both!; * METHOD 1: clogit ******************; * Step 1: generate choice specific dummies; gen party1 = vote==1; gen party2 = vote==2; gen party3 = vote==3; gen party4 = vote==4; * Step 2: generate _interactions_ of the choice specific dummies and case specific variables (here only religion); gen party1Xrelig = party1 * relig; gen party2Xrelig = party2 * relig; gen party3Xrelig = party3 * relig; gen party4Xrelig = party4 * relig; * Run clogit and compare to mlogit; clogit choice party1 party2 party3 party1Xrelig party2Xrelig party3Xrelig, group(respid); preserve; use dutch271uncond.dta, clear; mlogit party relig, base(3); restore; * METHOD 2: asclogit ********************; asclogit choice, case(respid) alternatives(vote) casevar(relig) base(4); exit;