I tried to fit a poisson model, , I used the new function resp_rate instead of the offset term.
and I got a error like this:
Error in model.frame.default(all_vars_terms, data, na.action = na.pass, :
invalid type (list) for variable 'resp_rate(area)
My code:
fit_culm_numbers<-brm(formula=cNo~canopy*year2+resp_rate(area)+(1|plot),
-
family = poisson(),
-
data=dd,
-
seed=1,
-
prior=c(set_prior("",class="Intercept"),
-
set_prior("",class="sd")),
-
chains=4,
-
iter=50000,
-
warmup=20000,
-
thin=1,
-
control = list(adapt_delta=0.97,max_treedepth = 15,stepsize=0.001))
I try to use as.data.farame or unlist , but it was not work. I got the same error.
below is my data:
thanks everyone