Lee van Cleef
2015-Jan-15 18:13 UTC
[R] Mlogit: Error in model.frame.default/ Error in solve.default
Dear R users, 1) My problem in short: Mlogit cannot calculate certain conditional models. 2) My database: The target was a logistical regression analysis and a probability function which should include generic coefficients and alternative-specific ones. The database was a survey, the dependent variable consisted of six possible choices. I worked with two databases: First, the true survey data (out of the six choices, one is quite dominant with a share of around 40%, two have around 20% each, and the remaining are marginal). Second, the survey with randomized values for both choice and independent variables to avoid the possible problems with the less uniform distribution of the choice variable in the true set. Both datasets include 725 individuals with twelve variables due to receive a generic coefficient and 25 individual ones which should have an alternative specific coefficient. I have already to note that the problems above emerged when estimating with only one independent variable. Before the estimate, both datasets were brought into the required long format. The original data in the long format looked ok. 3) The estimates and the issues. I started in both datasets with an estimate with only one variable with a generic coefficient. I used the following order: mlogit(choice ~ variable, data = survey_long) R?s comment was ?Error in solve.default(H, g[!fixed]) : system is computationally singular: reciprocal condition number = ...?. I was able to get an estimate for such a comparably simple model when using mlogit(choice ~ variable | 0, data = survey_long). However, the output did not contain estimates on the alternative specific coefficents for the intercept. I continued by gradually adding variables with generic coefficients. If it was more than five of them, R?s message was ?Error in solve.default(H, g[!fixed]) : system is computationally singular: reciprocal condition number = ...?. One of the variables had the problem ?Error in model.frame.default(terms(formula, lhs = lhs, rhs = rhs, data = data), : variable lengths differ (found for 'C15_CC_Dist')?. I compared the length for all the variables, and it was all the same. Another thing: It was impossible to add variables with an alternative specific coefficient: ?Error in solve.default(H, g[!fixed]) : system is computationally singular: reciprocal condition number = ...?. These statements appeared both when using the true survey as well as when using the randomized data. Does anyone have any comment or help on that? What can I do? I can send the datasets if required. Any comment would be helpful. Best regards, LvC -- View this message in context: http://r.789695.n4.nabble.com/Mlogit-Error-in-model-frame-default-Error-in-solve-default-tp4701843.html Sent from the R help mailing list archive at Nabble.com.