{"action":"created","issue":{"url":"https://api.github.com/repos/paul-buerkner/brms/issues/44","repository_url":"https://api.github.com/repos/paul-buerkner/brms","labels_url":"https://api.github.com/repos/paul-buerkner/brms/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/paul-buerkner/brms/issues/44/comments","events_url":"https://api.github.com/repos/paul-buerkner/brms/issues/44/events","html_url":"https://github.com/paul-buerkner/brms/issues/44","id":134431199,"number":44,"title":"Error in zero_inflated_beta model, when there is a non-relevant column with type 'logical'","user":{"login":"alireza202","id":6646274,"avatar_url":"https://avatars.githubusercontent.com/u/6646274?v=3","gravatar_id":"","url":"https://api.github.com/users/alireza202","html_url":"https://github.com/alireza202","followers_url":"https://api.github.com/users/alireza202/followers","following_url":"https://api.github.com/users/alireza202/following{/other_user}","gists_url":"https://api.github.com/users/alireza202/gists{/gist_id}","starred_url":"https://api.github.com/users/alireza202/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alireza202/subscriptions","organizations_url":"https://api.github.com/users/alireza202/orgs","repos_url":"https://api.github.com/users/alireza202/repos","events_url":"https://api.github.com/users/alireza202/events{/privacy}","received_events_url":"https://api.github.com/users/alireza202/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paul-buerkner/brms/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-17T23:19:37Z","updated_at":"2016-04-04T07:54:29Z","closed_at":"2016-04-04T07:54:29Z","body":"This is a strange error I was getting, and it took me some time to figure it out. My dataframe had a column with type logic (say x3, with all NA values). When I ran ZIB model with `trait` in the formula, I would get:\r\n\r\n> Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]): contrasts can be applied only to factors with 2 or more levels\r\n\r\nAnd I was not using that column in my formula! If I removed `trait` from the equation it would run though.\r\n\r\nI figured out when I remove the offending column, it runs.\r\n\r\nHere is my brm call:\r\n\r\n```\r\nbrm(formula = d ~ 0 + trait * (x1 + x2) + (0 + trait | item), \r\n    data = df,\r\n    family = 'zero_inflated_beta',\r\n    chains = 2,\r\n    cluster = 2,\r\n    iter = 1000, \r\n    warmup = 300) -> fitted_model\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/paul-buerkner/brms/issues/comments/205180185","html_url":"https://github.com/paul-buerkner/brms/issues/44#issuecomment-205180185","issue_url":"https://api.github.com/repos/paul-buerkner/brms/issues/44","id":205180185,"user":{"login":"paul-buerkner","id":12938496,"avatar_url":"https://avatars.githubusercontent.com/u/12938496?v=3","gravatar_id":"","url":"https://api.github.com/users/paul-buerkner","html_url":"https://github.com/paul-buerkner","followers_url":"https://api.github.com/users/paul-buerkner/followers","following_url":"https://api.github.com/users/paul-buerkner/following{/other_user}","gists_url":"https://api.github.com/users/paul-buerkner/gists{/gist_id}","starred_url":"https://api.github.com/users/paul-buerkner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paul-buerkner/subscriptions","organizations_url":"https://api.github.com/users/paul-buerkner/orgs","repos_url":"https://api.github.com/users/paul-buerkner/repos","events_url":"https://api.github.com/users/paul-buerkner/events{/privacy}","received_events_url":"https://api.github.com/users/paul-buerkner/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T07:54:29Z","updated_at":"2016-04-04T07:54:29Z","body":"Thanks for the reply @alireza202. All of my own tests are suggesting that it is fixed. Also, I have added unit tests to make sure I won't accidently bring it in again. Accordingly, I think that this issue can be closed  now. In case you somehow run into the same problem again, please feel free to reopen it."}}