0

I am trying to run a logistic regression with the data structure as follows (The original data has 10 columns and 296 rows in the format as shown in the example):

Food  d.bri  d.cau  d.bre  d.pea  FA     FC     Delay   Agg     Rej
F1    1      0      0      0      5.00   3.00   2.00    3.00    0.00
F2    0      1      0      0      4.00   4.00   3.00    5.00    0.00
F3    0      0      1      0      3.00   5.00   5.00    7.00    0.00
F4    0      0      0      1      2.00   2.00   4.00    7.00    0.00
F1    1      0      0      0      5.00   5.00   5.00    7.00    0.00
F3    0      0      1      0      4.00   4.00   4.00    7.00    0.00
F2    0      1      0      0      3.00   3.00   5.00    7.00    0.00
F4    0      0      0      1      2.00   2.00   5.00    7.00    0.00

Transformation of the data has been done with

l.data = mlogit.data(DATA, choice = 'Food', shape = 'wide')

With the following multinomial code, I get the result as expected.

FC_F1 = mlogit(Food ~ 1 | FC, data = l.data, reflevel = 'F1')

However, on trying to run a conditional model, I get the following error

Lapack routine dgesv: system is exactly singular: U[4,4] = 0

The code I am using is

c.logit_F1 = mlogit(Food ~ Agg+Delay|FC, data = l.data, reflevel = 'F1')

I am unsure as to what is causing the problem.

Please help.

Phil
  • 7,287
  • 3
  • 36
  • 66
  • Welcome to SO. Please make your question reproducible check out [ask] and [mre]. You could add a minimal set of your data with `dput(DATA)` or `DATA <- data.frame(...)` where ... are the elements of your data frame; only including the variables and enough rows to reproduce the issues which your question addresses. – Peter May 11 '20 at 09:00
  • That's an issue with your data. The model might be too complex for your data. – Roland May 11 '20 at 10:03

0 Answers0