# Is using a mixed model with random intercept and random slope appropriate for this problem?

I have a dataset with customer reviews of products and product features. Each customer reviews multiple products, but customers don't necessarily review the same products. The products are similar, they share the same features. I need to prove that different customers value product features differently.

I fit a mixed model with a random intercept and a random slope for each customer to the data in R using lmer.

model1 = lmer('review ~ (1 + feature1 + feature2 |customer) + feature1 + feature2')


I'm unsure how to test if they value the product features. I read I should test if the variance for the feature coefficients is significantly different from 0, but I don't know how to do that.

I also fit a model with only a random intercept.

model2 = lmer('review ~ (1 |customer) + feature1 + feature2')


And I ran the anova test:

anova(model2, model1)


and got the following output:

Models:
model1: review ~ (1 | customer) + feature1 + feature2
model2: review ~ (1 + feature1 + feature2 | customer) + feature1 + feature2
npar   AIC   BIC  logLik deviance Chisq Df Pr(>Chisq)
model1    5 13594 13626 -6791.7    13584
model2   10 13599 13663 -6789.3    13579 4.866  5     0.4325


Since the p-value is very high, does this prove customers don't value product features differently? If I had gotten a small p, would that mean they do value them differently?

Is this a valid way to test my claim or is there other ways I can test this?

• What are the features? How are they measured? How many products did each person review? Commented Aug 23, 2023 at 17:45
• @PeterFlom the products are cellphones from different brands, the features are their technical specifications and their price, the number of reviews per customer varies. Commented Aug 23, 2023 at 18:05

What this implies is that the effect of the two features on the review does not vary between customers (their effect on the review, whatever it is--you need to look at the fixed effects--is the same across customers)

To see the fixed effects, take a look at summary(model2) (or you could opt to retain model 1 with random intercepts but fixed slopes, seeing as there is no significant variation in slopes when tested together)

• Your first sentence seems to me to answer the OP's question, with a "Yes, they don't vary" but then the next bit says "you need to look at fixed effects". I'm confused as to what you are saying. Maybe it needs editing? Commented Aug 23, 2023 at 17:48
• I'm not sure where the confusion comes from. OP shows a test of random effects, but she sounds interested in fixed effects. You can get any combination of significant or non significant fixed effects with any combination of significant or non significant random effects. Fixed effects test whether average effects are 0 (here, across customers), random effects test whether these effects (regardless of whether they are 0 or not on average) vary across customers. She tested the variance of the effects (random effects), she's interested in the means of the effects (fixed effects). Commented Aug 23, 2023 at 17:55