0

I am trying to do a mvglmer fit with jmbayes with the following snippet data of the first patient:

****id1     predx**    
1011025 Prednisolone        
               
**wks ecgrate_binary ecgpri_binary** 
  0              1                 0    

Here is the code:

mvFit1 <-  mvglmer(ecgrate_binary ~treatment+ time+(time|id),
                   ecgpri_binary ~treatment+time +(1|id),
                   data = my_df, 
                   families = list(binomial(link = "logit", binomial(link = "logit"),
                   engine ="STAN")

Which produces the error

Error in x$terms : object of type 'symbol' is not subsettable

In my data, I have repeated measurements for each patient, which are binary coded as 0 or 1 (i.e.ecgrate_binary, ecgpri_binary).

I have browsed stackoverflow and found similar issues; however, I have not been able to solve the problem. I, unfortunately, can't provide the link to the data as this is for my thesis.

user20650
  • 24,654
  • 5
  • 56
  • 91
  • The following link provides methods on how to create a reproducible example: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – user20650 Aug 13 '23 at 18:29
  • are you missing a closing parenthesis in the `families` argument e.g. should it be `families = list(binomial(link = "logit"), binomial(link = "logit"))` – user20650 Aug 13 '23 at 18:31
  • should the two formulas be in a `list` ; according to the help page https://search.r-project.org/CRAN/refmans/JMbayes/html/mvglmer.html – user20650 Aug 13 '23 at 18:34
  • @user20650 my mistake when i was posting the question. I still have the same error even when I put the formulas in a list – Modiehi Aug 13 '23 at 19:28

0 Answers0