# Which type of regression?

I want to run a regression and I have a scale dependent variable that goes from 0 (extremely pessimistic) to 10 (extremely optimistic). My independent variables are only categorical variables such as age groups (15-24, 25-34, 35-44 etc.), gender, education level (Primary, Secondary, Tertiary etc.). My purpose is to find which demographic group exhibits the most pessimistic attitude. In other words, I am trying to explain the respondents' score (scale dependent variable) as a function of their demographic characteristic (independent variable). Which type of regression could help me to do so? I was thinking about using OLS, even though my dependent variable is clearly not continuous.

You can implement ordinal logistic regression in R using the polr function in the MASS package (this function implements "proportional odds" logistic regression). If you want to add random effects to the model you can use the clmm2 function in the ordinal package. In either case you use the standard syntax for specifying the regression relationship in the model. In particular, you can implement categorical explanatory variables in this model in the usual method, by specifying these as factor variables.