*The steps for running the mixlogit command with more than 20 random variables in Stata software are described below cap clear all cap log close _all set niceness 10 *set processor 4 set max_memory 16g set more off set seed 911 cls *Updapte Stata before update query *mixlogit command egen csid = group(id group) * The mixlogit command does not allow more than 20 random variables natively. To alleviate this, we have to define the matrix with Mata *Pseudo-random draws mata: nrep = Number of draws repetitions mata: krnd = the number of random variables mata: burn = 16 mata: nresp = the number of respondents mata: rseed(12345) mata: mixl_USERDRAWS = runiform(krnd,nrep*nresp) mixlogit depvariable, group(csid) id(id) rand(indepvariables) nrep(500) userdraws