Hi
I’m trying to make a fit in R, and the return is always “Error: Expecting a single value when fixing parameter ‘data.Day_number’.”
I’ve tried to reopen, rerun, rename, recode and delete entire unnecessary columns (and then the error just moves to the column to the right). My data is greatly skewed towards zero, wherefore I use the zero-inflated_binomial.
I could really use some help to understand why this happens :)
A lot of renaming and defining classes first, and then my current fit:
prior1 ← prior(normal(0,1000), class = b)
fit1 ← brm(formula = bf(Scab_branch | Leaves ~ Ants_tree + Tree_sort, data = mydata,
family = zero_inflated_binomial(link=“logit”, link_zi = “logit”),
prior = prior1, chains = 4, iter = 20000))
Thank you!
Are you able to provide your formatted data, or comparable simulated data on which you can reproduce the issue?
No; the idea is to have something that we can run ourselves to reproduce the error.
This is a section of my data, and then the code would be:
prior1 <- prior(normal(0,1000), class = b)
fit1 <- brm(formula = bf(PEST1 | NUMBER ~ PESTICIDE1 + NAME, data <- Datasection,
family = zero_inflated_binomial(link="logit", link_zi = "logit"),
prior = prior1, chains = 4, iter = 20000))
Datasection.csv (2.2 KB)
Is this sufficient?
edited by @jsocolar for syntax highlighting
You had a misplaced parenthesis and a missing call to trials()
. This should work:
library(brms)
Datasection <- read.delim("/Users/jacobsocolar/Downloads/Datasection.csv", sep = ";")
prior1 <- prior(normal(0,1000), class = b)
fit1 <- brm(formula = bf(PEST1 | trials(NUMBER) ~ PESTICIDE1 + NAME), data = Datasection,
family = zero_inflated_binomial(link="logit", link_zi = "logit"),
prior = prior1, chains = 4, iter = 20000)