I am trying to fit an ordered regression model but with random parameters as explained in random parameter multinomial for the multinomial model.
This means allowing the variable coefficients to vary across the population according to some pre-specified distribution and If a coefficient is found to vary significantly across observations, it implies that each observation has its own coefficient.
I understand that brms can fit the multilevel models but my data cannot be clustered because each observation represents an accident with its corresponding attributes. I have 926 accidents and below is the sample of the data I am working on with Y as response variable and all the X’s as predictors. I have been looking around the forum but could not find anything to help me with my problem I will appreciate some pointers on how to achieve this using Brms (if possible). Thank you.
ID Y X1 X2 X3 X4 X5
1 Minor Thursday Spring Weekday Day No
2 PDO Wednesday Spring Weekday Dark Yes
3 Serious Friday Summer Weekend Dark Yes
4 PDO Wednesday Summer Weekday Day No
5 PDO Thursday Summer Weekday Day Yes
6 Minor Tuesday Fall Weekday Day No
7 Serious Sunday Summer Weekend Day No
8 PDO Friday Spring Weekend Day Yes
9 Serious Thursday Spring Weekday Day Yes
10 Minor Thursday Spring Weekday Dark Yes
11 PDO Saturday Spring Weekend Day No
12 PDO Thursday Summer Weekday Dark No
13 PDO Saturday Fall Weekend Day No
14 Minor Monday Summer Weekday Day No
15 Minor Monday Summer Weekday Dark No
16 Minor Monday Spring Weekday Dark No
17 PDO Sunday Spring Weekend Dark Yes
18 Minor Sunday Spring Weekend Day Yes
19 Minor Friday Fall Weekend Day No
20 Minor Sunday Summer Weekend Dark Yes
Thank you for your response, I have edited the topic and added a link that explains the random parameter model for multinomial regression. I am trying to achieve the same for bayesian ordered regression.
I don’t have time to read the paper you linked to, but for response distributions that don’t have a free scale parameter, you can include a per-observation random effect: brm(Y ~ X1 + ... + (1 | ID), ...). Not sure about multinomial but maybe worth a shot eh?
Thank you again. I have come to realize what I am looking for is what is called Distributional Models in the BRMS package. The example of the model provided in the BRMS tutorial however considers the gaussian distribution and models both the mean and standard errors as: brm(bf(Y~X1+…,sigma~X1+…),data=…)
Are these models possible for ordered response variables, and how can I specify the other parameters of the apart from the mean. Please excuse me if the question is so basic. I would appreciate any help.
The paper below explains how to fit ordinal models with brms (Box 1, page 7). You can model the latent scale with something like brm(bf(Y ~ X, disc ~ X), ...).
Hi @matti, thank you for pointing me in the right direction. I was able to specify the model for my data as described in the paper for the cumulative ordinal regression. However, I came to an impasse again due to an error after fitting a category specific model because some of my variables did not follow the proportional odds (PO) assumption.
I started with a very simple model with a single variable (that does not follow the PO assumption) and accounting for unequal variances. My line of code was as shown below.
Thank you for your reply. I have attached subset of the data used for fitting the model. Time was treated as categorical variable and the code specification was as mentioned in my previous post.
The problem is simply that category specific effects are not supported for disc but only for the main parameter. I am not even sure CS on disc would be sensible, that is, identified at all.
In any case, the error message is confusing and I will try to improve it.