How to specify two variable as equal levels of a varaible factor?


In my dataset, I have a variable called Condition. I modeled this as a factor with two levels: Control and Treatment. In the same data frame, I also have variables: Fish1, Fish2, Frechfires1, Frenchfries2. I want to model these ‘Ordinalvariables’ as levels of the treatment group with Fish higher than the fires! At the same time, I want to keep the level of Fish1 and Fist 2 equal and the same for fries1&2- all for “Treatment” (which is a level of the variable " CONDITION".

sorry, but I couldn’t really understand your question. Are you using pure Stan or rstanarm or brms? If so, could you provide Stan code or formulas you are using as well as example of the data you work with?


Perhaps this is more an issue of data organisation rather than modeling? If I understand correctly, you have an ordinal variable relating to type of food, where “fish” is greater than “fries”. What is the meaning of the …1 and …2 labels? It’s not clear to me how that relates to the “Condition” variable, as you seem to suggest that all of this data only applies to the “Treatment” condition.

If you are interested in fitting a model with ordinal predictors using brms, you might find this vignette useful.

1 Like