[R] mlogit and weights
Misha Spisok
misha.spisok at gmail.com
Thu Jun 3 08:45:15 CEST 2010
Hello,
I can't figure out why using and not using weights in mlogit yields
identical results. My motivation is for the case when an
"observation" or "individual" represents a number of individuals. For
example,
library(mlogit)
library(AER)
data("TravelMode", package = "AER")
TM <- mlogit.data(TravelMode, choice = "choice", shape = "long",
alt.levels = c("air", "train", "bus", "car"))
myweight = rep(floor(1000*runif(nrow(TravelMode)/4)), each = 4)
summary(mlogit(choice ~ wait + vcost + travel + gcost, data=TM))
summary(mlogit(choice ~ wait + vcost + travel + gcost, weights=income, data=TM))
summary(mlogit(choice ~ wait + vcost + travel + gcost,
weights=myweight, data=TM))
Each gives the same result. Am I specifying "weights" incorrectly?
Is there a better way to do what I want to do? That is, if "myweight"
contains the number of observations represented by an "observation,"
is this the correct approach? If so, what am I doing wrong? If not,
what suggestions are there?
Thank you for your time.
Best,
Misha
More information about the R-help
mailing list