I am trying to run a linear mixed model for a sentiment analysis with movie reviews. There are 32000 different titles in my data frame and each title has a varying number of reviews (review_number). review_number is a sequence starting from 1 for each title and is 937 at max. I calculated the emotionality and extremity for each review. The dummy critic indicates whether a review was written by a critic. I want to nest the reviews within titles. In total there are 1.2 Mio observations.
Sample:
title critic review_number review_emo review_extr
1 '64 - '95 0 1 -0.75908061 0.1051023
2 '64 - '95 0 2 -1.78770128 -1.2697559
3 '64 - '95 0 3 0.04826126 1.1797093
4 '64 - '95 0 4 1.56405819 0.5269304
5 '64 - '95 0 5 -0.82757559 0.1753819
6 '64 - '95 0 6 0.68578835 -0.5778072
This is the model I used:
mod <- lmer(review_emo ~ critic + review_extr + (1 | title/review_number),
data = df)
I receive this error message:
Error: number of levels of each grouping factor must be < number of observations (problems: review_number:title)
Why is that and how can I fix it? My grouping factor should be smaller than the number of observations because there are 32000 titles and a maximum of 937 reviews per title. I checked the number of levels with nlevels(x).
I looked this problem up in various posts but I can`t tell why it does not work for me.