I am trying to develop a mode choice model (4 modes: hov, transit, bike, walk) and below are two approaches I am using. I am having problems in both
Approach 1
Mode choice as a function of price (cost of using the mode)
price
: generic variable
trans1
: choice variable (0,1)
Dataset:work
Command:> mode.choice <- mlogit(trans1 ~ price, work) Error: Error in solve.default(H, g[!fixed]) : Lapack routine dgesv: system is exactly singular
P.S: Unlike previous posts, I don’t have NA’s in my dataset.
Approach 2
Mode choice as a function of price and some alternative specific variables
price
: Generic Variable
trans1
: choice variable (0,1)
hh1
,hh2
,hh3
: alternative specific variables
Dataset:work
Command:> mode.choice <- mlogit(trans1 ~ price | hh1 + hh2 + hh3, work) Error: Error in solve.default(H, g[!fixed]) : Lapack routine dgesv: system is exactly singular
I have tried different variables in both approaches but the singularity issue persists
Help on any of these approaches would be greatly appreciated.
price
coded in R (numeric
orfactor
)? Did you check if any of your response categories didn't occur as a unique combination of your predictors? See also this related thread. $\endgroup$mlogit.data()
command? If so, did you make sure thatprice
is indeed varying across alternatives? $\endgroup$price
doesn't vary across alternatives, you should call it asmlogit(trans1 ~ 1 | price)
$\endgroup$