GLMM with brms? Error: Additional formulas must be named

G’day

My research project involves determining the flavour preference and eating behaviours of Tasmanian devils. Other papers in this area have used GLMM, and I’ve been told my data is better suited for bayesian stats. I want to run a linear and non-linear model and compare them. My linear code runs fine, but I am having some trouble forming my non-linear data in preparation for running a brm.

I am attempting to run:

f_preference_nonlinear <- cEatenUneatenPartiallyLikely ~ 1 + iAge + 
  cSex +
  s(cFlavour, k=3, bs='ts') # this runs fine
f_shape <- ~ 1|cIndividualID #this runs fine
form_preference_nonlinear <- bf(f_preference_nonlinear, f_shape) + categorical()

This call I get the error message: Error: Additional formulas must be named.

I’ve googled the error message and can’t find anything; any help would be greatly appreciated.

Here’s the str call for the dataframe I am using:

spec_tbl_df [129 x 24] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
 $ X1                          : num [1:129] 9 10 27 28 32 36 37 38 41 53 ...
 $ X                           : num [1:129] 9 10 27 28 32 36 37 38 41 53 ...
 $ Date                        : chr [1:129] "4/05/2021" "4/05/2021" "5/05/2021" "5/05/2021" ...
 $ iDay                        : num [1:129] 1 1 2 2 2 2 3 3 3 1 ...
 $ cIndividualID               : chr [1:129] "Mowunna" "Mowunna" "Mowunna" "Mowunna" ...
 $ cSex                        : chr [1:129] "F" "F" "F" "F" ...
 $ iAge                        : num [1:129] 2 2 2 2 2 6 2 2 2 2 ...
 $ cFlavour                    : chr [1:129] "PigOut" "FoxOff" "FoxOff" "FoxShield" ...
 $ Dropped.with.L.R.nabber     : chr [1:129] "R" "L" "R" "L" ...
 $ cEatenUneatenPartiallyLikely: chr [1:129] "Eaten" "Eaten" "Eaten" "Eaten" ...
 $ iDaysSinceLastFed           : num [1:129] 1 1 1 1 1 1 1 1 1 1 ...
 $ dConsumed                   : num [1:129] 100 100 100 100 100 100 100 100 100 100 ...
 $ Start.time                  : num [1:129] 1440 1440 1325 1325 1418 ...
 $ End.time                    : num [1:129] 1515 1515 1346 1346 1437 ...
 $ Total.time                  : num [1:129] 35 35 21 21 29 30 35 35 34 33 ...
 $ iTemp                       : num [1:129] 13 13 15 15 15 14 10 10 12 10 ...
 $ Wind                        : num [1:129] 0 0 0 0 1 1 1 1 0 0 ...
 $ Cloud.cover                 : num [1:129] 0 0 0 0 10 15 100 100 100 80 ...
 $ Ground.cover                : num [1:129] 10 10 70 70 0 80 35 35 0 10 ...
 $ Baits.disappeared.overnight : chr [1:129] NA NA NA NA ...
 $ Scat.markers                : chr [1:129] NA NA "Y" "Y" ...
 $ Notes                       : chr [1:129] "Last fed 3/5 - fed last night; Pouch young" "Last fed 3/5 - fed last night; Pouch young" "Fed night before - as usual; Pouch young" "Fed night before - as usual; Pouch young" ...
 $ cSite                       : chr [1:129] "Trowunna" "Trowunna" "Trowunna" "Trowunna" ...
 $ iVisit                      : num [1:129] 1 1 1 1 1 1 1 1 1 2 ...
 - attr(*, "spec")=
  .. cols(
  ..   X1 = col_double(),
  ..   X = col_double(),
  ..   Date = col_character(),
  ..   iDay = col_double(),
  ..   cIndividualID = col_character(),
  ..   cSex = col_character(),
  ..   iAge = col_double(),
  ..   cFlavour = col_character(),
  ..   Dropped.with.L.R.nabber = col_character(),
  ..   cEatenUneatenPartiallyLikely = col_character(),
  ..   iDaysSinceLastFed = col_double(),
  ..   dConsumed = col_double(),
  ..   Start.time = col_double(),
  ..   End.time = col_double(),
  ..   Total.time = col_double(),
  ..   iTemp = col_double(),
  ..   Wind = col_double(),
  ..   Cloud.cover = col_double(),
  ..   Ground.cover = col_double(),
  ..   Baits.disappeared.overnight = col_character(),
  ..   Scat.markers = col_character(),
  ..   Notes = col_character(),
  ..   cSite = col_character(),
  ..   iVisit = col_double()
  .. )

Hi,
the problem is that f_shape has empty left-hand side. I however cannot suggest how to fix that as I don’t really understand what you are trying to achieve with f_shape - are you trying to build a bivariate model? Or are you trying to put predictors on some additional aspects of the distribution?

Best of luck with your model!