Note that there are some explanatory texts on larger screens.

plurals
  1. POError in glmer: NA/NaN/Inf in foreign function call (arg 1)
    primarykey
    data
    text
    <p>I'm trying to fit the model</p> <pre><code>glmer(trans.dummy ~ pop + year + (year | munname), data=pool, family=binomial(link = "logit"), REML=T, verbose=T) </code></pre> <p>but I keep receiving the following error:</p> <pre><code>Error in glm.fit(fr$X, fr$Y, weights = wts, offset = offset, family = family, : NA/NaN/Inf in foreign function call (arg 1) </code></pre> <p>I omitted NAs, changed the model specification, transformed pop to log(pop) but nothing solved the problem. I think the problem is on variable 'pop' given that is the only one that causes that problem. When I run</p> <pre><code>mod6 &lt;- glmer(trans.dummy ~ constituency.coa + I(governat.part) + I(district2) + gdp.cap + year + ifdm + year + (year | munname) + (year | uf), data=pool, family=binomial(link = "logit"), REML=T, verbose=T) </code></pre> <p>I don't have any problem.</p> <p>Any idea about what is happening?</p> <p>EDIT:</p> <p>This is the structure of my data:</p> <pre><code>'data.frame': 41484 obs. of 50 variables: $ munname : Factor w/ 5392 levels "ACACRELANDIA",..: 1 2 3 4 5 6 7 8 9 10 ... $ uf : Factor w/ 26 levels "AC","AL","AM",..: 1 1 1 1 1 1 1 1 1 1 ... $ year : int 2003 2003 2003 2003 2003 2003 2003 2003 2003 2003 ... $ party : Factor w/ 30 levels "DEM","PAN","PC do B",..: 21 25 25 8 21 10 10 25 10 10 ... $ candidate : Factor w/ 12600 levels "AARAO CRUZ MENDES",..: 11452 8535 6389 5910 8095 1995 6087 3996 4313 8417 ... $ may.coalit : Factor w/ 10442 levels "DEM","DEM / PC do B / PRB / PRP / PTN / PSL",..: 7987 10118 10119 4023 8004 10442 4023 10114 4023 3945 ... $ governat.part : Factor w/ 9 levels "PDT","PFL","PMDB",..: 9 9 9 9 9 9 9 9 9 9 ... $ transfers : num 920 100920 183698 200920 919 ... $ pop : num 8695 3667 17944 6641 6096 ... $ gdp : num 68507 17492 101626 47936 37903 ... $ bf : num 703 330 1339 335 455 ... $ ifdm : num 0.422 0.442 0.404 0.511 0.396 ... $ elec.num : int 45 13 13 15 45 11 11 13 11 11 ... $ may.votes : int 2394 1345 3864 1415 1434 9422 2313 5423 1078 3348 ... $ may.round : int 1 1 1 1 1 1 1 1 1 1 ... $ may.perc.votes : num 0.59 0.586 0.441 0.544 0.615 ... $ pt.position : Factor w/ 5 levels "0.No PT","1.PT mayor winner",..: 4 2 2 3 4 5 5 2 3 5 ... $ numb.cand : int 2 2 3 3 2 4 3 2 2 2 ... $ runup : Factor w/ 3 levels "1.PT","2.Coalition",..: 3 3 2 1 3 2 2 3 1 2 ... $ voters : num 6422 3158 12234 3721 3682 ... $ nation.turnout : num 4282 2150 7989 2624 2138 ... $ lula.vote : num 2202 1197 4579 1431 1138 ... $ lula.perc.vote : num 0.514 0.557 0.573 0.545 0.532 ... $ reelec : Factor w/ 2 levels "Able to Run",..: 1 1 1 2 2 1 1 1 1 1 ... $ constituency.pt : num 9.37e-05 9.41e-05 3.83e-04 4.92e-05 5.38e-05 ... $ constituency.coa: num 4.10e-05 1.64e-05 6.87e-05 2.88e-05 1.34e-05 ... $ constituency.opp: num 4.81e-05 1.16e-05 2.47e-05 2.41e-05 3.55e-05 ... $ transfers.cap : num 0.106 27.521 10.237 30.254 0.151 ... $ gdp.cap : num 7.88 4.77 5.66 7.22 6.22 ... $ bf.cap : num 0.0808 0.0899 0.0746 0.0504 0.0747 ... $ lula.power : num 1.32e-64 7.16e-65 2.74e-64 8.56e-65 6.80e-65 ... $ mun.vote : int 1 1 1 1 1 0 1 1 1 0 ... $ mun.vote2 : Factor w/ 2 levels "PSDB","PT": 2 2 2 2 2 1 2 2 2 1 ... $ mun.vote3 : Factor w/ 2 levels "0.PT","1.PSDB": 1 1 1 1 1 2 1 1 1 2 ... $ core : Factor w/ 3 levels "Lula Core Municipality",..: 3 3 3 3 3 3 3 1 3 3 ... $ mayor.party.r : int 0 2 2 1 0 0 0 2 0 0 ... $ mayor.party.r2 : Factor w/ 3 levels "0.PT","1.Coalition",..: 3 1 1 2 3 3 3 1 3 3 ... $ pt.dummy : int 0 1 1 0 0 0 0 1 0 0 ... $ trans.dummy : int 1 1 1 1 1 1 1 0 1 1 ... $ year2 : Factor w/ 4 levels "2003-2004","2005-2006",..: 1 1 1 1 1 1 1 1 1 1 ... $ district : Factor w/ 6 levels "PSDB/Coal","PSDB/Opo",..: 5 6 6 4 5 2 5 6 5 2 ... $ term : int 0 0 0 0 0 0 0 0 0 0 ... $ time : int 1 1 1 1 1 1 1 1 1 1 ... $ pt.pt : int 0 1 1 0 0 0 0 1 0 0 ... $ pt.coa : int 0 0 0 1 0 0 0 0 0 0 ... $ pt.opp : int 1 0 0 0 1 0 1 0 1 0 ... $ psdb.pt : int 0 0 0 0 0 0 0 0 0 0 ... $ psdb.coa : int 0 0 0 0 0 0 0 0 0 0 ... $ psdb.opp : int 0 0 0 0 0 1 0 0 0 1 ... $ district2 : Factor w/ 5 levels "Coal/Coal","Opp/Opp",..: 2 4 4 5 2 3 3 4 5 3 ... - attr(*, "na.action")=Class 'omit' Named int [1:1316] 59 235 242 409 437 555 588 594 645 673 ... .. ..- attr(*, "names")= chr [1:1316] "59" "235" "242" "409" ... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload