title: Error in mlogit: Error in solve.default(H, g[!fixed]) : system is computationally singular: reciprocal condition number = 3.4767e-18
body: <p>I have a conjoint survey data in long format. the first few rows look like this:</p>
  
  <pre><code> ID alt choice size tar length brand flavor gender age yr_smoke num_smoke job
   1  1   1     no    1   1      1     1      1      2  35       10        20   1
   2  1   2     no    1   1      1     1      1      2  35       10        20   1
   3  1   3     no    1   1      1     1      1      2  35       10        20   1
   4  1   4     no    1   1      1     1      1      2  35       10        20   1
   5  1   5     no    1   1      1     1      1      2  35       10        20   1
   6  1   6     no    1   1      1     1      1      2  35       10        20   1
  </code></pre>
  
  <p>I used mlogit.data as:</p>
  
  <pre><code>data_mlogit_ct1_test2 &lt;- mlogit.data(data_mlogit_ct1_test1,choice="choice",
  shape="long",alt.var="alt")
  </code></pre>
  
  <p>The first few rows of the transformed data looks like:</p>
  
  <pre><code>   ID alt choice size tar length brand flavor gender age yr_smoke num_smoke job
     1.1  1   1  FALSE    1   1      1     1      1      2  35       10        20   1
     1.2  1   2  FALSE    1   1      1     1      1      2  35       10        20   1
     1.3  1   3  FALSE    1   1      1     1      1      2  35       10        20   1
     1.4  1   4  FALSE    1   1      1     1      1      2  35       10        20   1
     1.5  1   5  FALSE    1   1      1     1      1      2  35       10        20   1
     1.6  1   6  FALSE    1   1      1     1      1      2  35       10        20   1
  </code></pre>
  
  <p>Now I am trying to fit mlogit as:</p>
  
  <pre><code> fit_mlogit_ct11 &lt;- mlogit(choice~size+tar+length+brand+flavor, 
                             data_mlogit_ct1_test1,shape="long",chid.var="ID",
                             alt.var="alt",method="bfgs",heterosc=TRUE,tol=10)
  </code></pre>
  
  <p>I got this error:</p>
  
  <p>Error in solve.default(crossprod(attr(x, "gradi")[, !fixed])) : 
    Lapack routine dgesv: system is exactly singular</p>
  
  <p>Then I did:</p>
  
  <pre><code>  fit_mlogit_ct11 &lt;- mlogit(choice~size+tar+length+brand+flavor, data_mlogit_ct1_test2)
  </code></pre>
  
  <p>Now I got:</p>
  
  <p>Error in solve.default(H, g[!fixed]) : 
    system is computationally singular: reciprocal condition number = 3.4767e-18</p>
  
  <p>Can somebody please help me?</p>