[R] mlogit: message "invalid 'row.names' length" after subsetting data

craux charles.raux at let.ish-lyon.cnrs.fr
Thu Jan 30 19:13:47 CET 2014


Hi!
I have been working a while with mlogit, estimating successfully a series of
models. 
This time I have a series of discrete choice experiments with different
effects to test (var Effect). I use the code below: when I estimate the
first model with "dd" it's work fine. Then I perform subset dd into dd1,
filtering the category of Effect "none", and I get the expected subset of
experiment (1800 rows = choices). When I estimate the model with dd1 I get
the error message "invalid 'row.names' length".
What is wrong?
-------
library(mlogit)
dd <- mlogit.data(Dataset, varying = 17:24, choice = "choice", id.var =
"ID", shape = "wide", sep = "_")
summary(m1 <- mlogit(choice ~ price + duration, dd))
dd1 <- subset(dd, dd$Effect=='none')
summary(m1 <- mlogit(choice ~ price + duration, dd1))
------




--
View this message in context: http://r.789695.n4.nabble.com/mlogit-message-invalid-row-names-length-after-subsetting-data-tp4684465.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list