R Under development (unstable) (2025-04-25 r88178 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library("mlogit") Loading required package: dfidx Attaching package: 'dfidx' The following object is masked from 'package:stats': filter > data("TravelMode", package = "AER") > TravelMode$choice2 <- TravelMode$choice == "yes" > TravelMode$incair <- with(TravelMode, income * (mode == "air")) > tm_cl <- mlogit(choice2 ~ gcost + wait + incair, data = TravelMode, shape = "long", choice = "choice", alt.var = "mode", reflevel = "car") > # Greene table 21.15 first column > tm_hl <- mlogit(choice2 ~ gcost + wait + incair, data = TravelMode, shape = "long", choice = "choice", alt.var = "mode", reflevel = "car", heterosc = TRUE) > # Greene table 21.15 second column > tm_nl <- mlogit(choice2 ~ gcost + wait + incair, data = TravelMode, shape = "long", choice = "choice", alt.var = "mode", reflevel = "car", nests = list(fly = "air", ground = c("bus", "car", "train")), unscaled = TRUE) > > ## tm_ml <- mlogit(choice2 ~ gcost + wait + incair, data = TravelMode, > ## shape = "long", choice = "choice", alt.var = "mode", reflevel = > ## "car", rpar = c(altair = "n", alttrain = "n", altbus = "n", gcost = > ## "n", wait = "n", incair = "n"), R = 400) > > > proc.time() user system elapsed 1.93 0.48 2.43