I am trying to estimate a multinomial logit model with the mlogit package. I don't know how to deal with variables that don't apply to all alternatives. For example, I have four transportation modes (walk, bike, public transport and car) and the variable "cost" applies only to the car and public transport. When I import the csv file into R and try to estimate the model I become this error message:
Error in reshapeLong(data, idvar = idvar, timevar = timevar, varying = varying, :
'varying' arguments must be the same length
How can I make R understand that the cost variable describes only two of the alternatives and not all of them?