// import the data into a dataset called Data and generate a constant term
Data = webimport("www.bayeconsoft.com/datasets/CCES2017.csv");
Data.constant = 1;
// run the multinomial Logit and Probit models
myMNLogit = mnlogit(
action ~ constant age educ male homeowner ideology faminc,
"draws"=20000, "burnin"=20000, "thin"=5, "chains"=2 );
myMNProbit = mnprobit(
action ~ constant age educ male homeowner ideology faminc,
"draws"=20000, "burnin"=20000, "thin"=5, "chains"=2 );
// calculate marginal effects for the two models at the means of the
// independent variables
mfx( "model"=myMNLogit, "point"="mean" );
mfx( "model"=myMNProbit, "point"="mean" );
// compare the two models
pmp( { myMNLogit, myMNProbit } );