Missing comments and text-derived estimates
A simulation study of what happens to summaries of open-ended comments when respondents skip the comment box, and whether the ratings that every respondent gave can correct them.
Motivation
Course evaluations, organizational surveys, and customer feedback forms usually pair rating questions with an optional comment box, and many respondents leave the box blank. If the decision to write a comment is related to how respondents perceive their experience or to what they want to say, summaries of the written comments, such as “overall sentiment is positive,” can be biased.
This project treats a skipped comment as missing data. I derive three outcomes from the comments: (1) mean tone, (2) the share of comments that mention the course workload, and (3) how tone changes with the difficulty rating. I then use the ratings that every respondent gave to correct for the missing comments, while the simulation controls how many comments are missing and why. The design combines natural language processing, which turns each comment into numbers, with a missing-data framework, so that I can evaluate how much bias different amounts and kinds of missing comments introduce and how far the ratings can recover the three outcomes.
Data
The project uses a public sample of the RateMyProfessor data set (He, 2020): 20,000 student posts, each with a 1–5 quality rating, a 1–5 difficulty rating, and a comment. I excluded posts missing either rating and the 970 posts without a comment, which left an analytic sample of 19,025 commented posts from 1,415 professors. Posts are clustered within professors (up to 20 per professor), and 39% of the variance in quality ratings lies between professors.
| Measure |
Method |
Population value |
| Tone |
P(positive) − P(negative) from a three-class sentiment model (Loureiro et al., 2022), from −1 to 1 |
Mean 0.30 |
| Workload |
1 if the comment talks about the amount of work or time the course demands, heavy or light, from two keyword lists |
25.9% of comments |
Tone tracks the quality rating closely (r = .83). Mentioning workload is unrelated to the quality rating (r = −.01) and to the difficulty rating (r = −.01).
Checking the workload measure. Comments were coded by hand as discussing workload or not (exams or grading alone, lecture style, and general difficulty do not count). A first sample of 120 comments was used to write the keyword lists, so its accuracy is optimistic. A second, independent sample of 80 comments was coded without seeing the keyword flags. Both samples are stratified by flag, so precision and recall are weighted to the full set of comments.
| Sample |
Precision |
Recall |
Hand-coded share discussing workload |
| Development (120, used to write the lists) |
.76 |
.91 |
27% |
| Holdout (80, independent) |
.75 |
.60 |
32% |
Three in four flagged comments discuss workload, and the measure catches about 60% of comments that do. It misses effort described indirectly (“you have to put in the time,” “a lot of memorization”). The results below concern comments the measure flags.
Design
Sampling. Each replication draws 150 professors (about 2,000 posts) and keeps all of their commented posts.
Missing comments. A comment is deleted with probability given by a logistic model, calibrated so that 30%, 50%, or 80% of comments are missing. Every mechanism includes a professor-level random effect (SD 0.5 on the log-odds scale), because students of some instructors comment more than others. The driving variable shifts the log-odds of a missing comment by 1 per SD.
| Mechanism |
Who skips the comment |
Type |
| At random |
No one in particular |
Missing completely at random |
| Satisfied students skip |
Students who gave higher quality ratings |
Missing at random given the ratings |
| Positive comments go unwritten |
Students whose comment would have been positive |
Missing not at random (depends on tone) |
| Workload complaints get written |
Students without something to say about workload |
Missing not at random (depends on content) |
What is estimated. Three summaries of all comments in the population: mean tone (0.30), the share of comments mentioning workload (26%), and the slope of tone on the difficulty rating (−0.25).
Methods. All corrections use the quality rating, the difficulty rating, and the year of the post.
| Method |
Point estimate |
Naive interval |
Cluster-aware interval |
| Commenters only |
Comments that were written |
— |
Cluster-robust standard errors |
| Weighting (IPW) |
Weighting by the inverse of the estimated probability of commenting |
Treats the probabilities as known and posts as independent |
Cluster bootstrap (200 resamples of professors) that refits every model |
| Doubly robust (AIPW) |
Augmented IPW with outcome regressions (Robins, Rotnitzky, & Zhao, 1994) |
Influence-function standard errors |
Same cluster bootstrap |
| Multiple imputation (MI) |
mice with predictive mean matching for tone and logistic regression for workload (m = 20) |
Single-level imputation, model-based standard errors |
Professor-level mean ratings added to the imputation model; cluster-robust variances pooled with Rubin’s rules |
Evaluation. 500 replications per condition. For each method: bias (the average estimate minus the population value), root mean squared error, coverage (the share of 95% intervals that contain the population value, which should be about .95), and interval width. Monte Carlo standard errors are about 0.01 for coverage and about 0.002 for the bias of mean tone.
Further analyses. A check of what the quality rating contributes to the corrections, and a sensitivity analysis for missingness that depends on what the comment would have said, applied to both the simulation and the real skipping in the data (described after the results).
Results
Mean tone at a glance. The mean tone of all comments is 0.30 on a scale from −1 to 1. Each cell shows the average estimate from the written comments alone → after correction (the average of weighting, the doubly robust estimator, and imputation, which agree within 0.02).
| Why comments are missing |
30% missing |
50% missing |
80% missing |
| At random |
0.30 → 0.30 |
0.30 → 0.30 |
0.30 → 0.30 |
| Satisfied students skip |
0.16 → 0.30 |
0.03 → 0.30 |
−0.22 → 0.30 |
| Positive comments go unwritten |
0.12 → 0.25 |
−0.03 → 0.20 |
−0.30 → 0.09 |
| Workload complaints get written |
0.30 → 0.30 |
0.30 → 0.30 |
0.29 → 0.29 |

-
When a rating explains who skips, the corrections remove the bias. If satisfied students skip the comment box, the comments that remain look far less positive than students’ views overall: mean tone falls from 0.30 to 0.03 when half the comments are missing and to −0.22 when 80% are. Weighting, the doubly robust estimator, and imputation all return estimates within 0.004 of 0.30.
-
When skipping depends on what the comment would say, the corrections help only as far as a rating tracks it.
- Positive comments go unwritten. With half the comments missing, the remaining ones look neutral (−0.03); with 80% missing, they look negative (−0.30), although 59% of all comments are clearly positive. The corrections recover about two thirds of the gap (0.20 and 0.09). They recover that much because tone tracks the quality rating closely (comments on 1-star posts average −0.80 and on 5-star posts 0.86), so the corrections can give extra weight to the highly rated posts that lost the most comments (a direct check below confirms that the quality rating does this work). They cannot recover the rest because, among students who gave the same rating, the most positive comments were still the most likely to go unwritten. All three corrections assume that written and unwritten comments from students with the same ratings are alike, and the ratings hold no information about this difference. The estimates therefore stay too low, and even cluster-aware 95% intervals contain the population value only 72–74% of the time at 30% missing and almost never at 80%.
- Workload complaints get written. If students with something to say about workload are the ones who write, the written comments put the share mentioning workload at 35%, 44%, and 64% instead of 26%. No rating tracks workload (r = −.01 with both ratings), so the corrections barely move these figures (34%, 43%, and 62%).

- Correcting the bias is not enough; the intervals also have to reflect that students rate the same professors. Posts about the same professor resemble each other, so 2,000 posts from 150 professors carry less information than 2,000 independent posts. Where the corrections are unbiased, intervals that treat posts as independent are too narrow: for mean tone, naive intervals from the doubly robust estimator and imputation contained the population value only 67–80% of the time, and naive weighting intervals 70–94%. The cluster bootstrap and cluster-aware imputation restored coverage to .94–.97, with intervals up to twice as wide. The gap is smaller for the workload share and the slope, which vary less between professors.
In addition, the doubly robust estimator gave narrower intervals than weighting for the slope at 80% missing (0.10 against 0.12), and imputation overstated the workload share slightly as more comments were missing (by 0.8 points at 50% and 2.3 at 80%), which kept its coverage near .89. All tables are in results/.
What the quality rating contributes
Comparing scenarios cannot show how much of the recovery comes from the quality rating, because each scenario changes both the outcome and how comments are selected. This check holds both fixed. In the scenario where positive comments go unwritten, at 50% missing, it reuses the exact samples and deletion masks of the main simulation (500 replications) and fits one estimator, weighting, with three sets of predictors. With all three predictors, it reproduces the main simulation’s estimates and intervals exactly.
| Predictors in the weighting model |
Mean tone (population value 0.30) |
Share of the bias removed |
Coverage of 95% intervals |
| None (written comments only) |
−0.03 |
— |
— |
| Difficulty and year |
0.03 |
19% |
.00 |
| Quality only |
0.20 |
69% |
.29 |
| Quality, difficulty, and year (main simulation) |
0.20 |
69% |
.30 |
The quality rating does almost all of the work. Difficulty and year on their own remove 19% of the bias, mainly because difficulty is related to both tone (r = −.42) and quality (r = −.45); once quality is in the model, they add nothing. In this setting, the share of the bias removed closely matches how much of the variation in tone each set of predictors explains (R² = .18 for difficulty and year, .69 once quality is included): a correction can recover only as much as its predictors know about what drives the missingness.
Sensitivity analysis
All of the corrections above assume that, among students who gave the same ratings, written and unwritten comments are similar. The observed data cannot check this assumption. A sensitivity analysis replaces it with a selection model whose strength the analyst sets (exponential tilting; Rotnitzky, Robins, & Scharfstein, 1998):
logit P(comment missing | ratings, y) = h(ratings) + γ · y / SD(y)
Here y is the comment’s tone or whether it mentions workload, SD(y) is its standard deviation among written comments, and γ is the extra log-odds of skipping for a comment 1 SD higher on y than a comment from a student with the same ratings. γ = 0 is the assumption behind the corrections above; γ > 0 means that more positive comments (or comments that mention workload) are more likely to go unwritten, and γ < 0 the reverse. Because the workload measure is 0 or 1, γ = 1 is a strong assumption for it: depending on how common mentions are, comments that mention workload would have about 7 to 13 times the odds of being skipped. For each γ, the weights are calibrated so that the written comments reproduce the ratings of the posts whose comment is missing, and intervals come from the same cluster bootstrap. The simulation was rerun (500 replications per condition) with γ from −1.5 to 1.5.

-
With the right assumption, the estimate is right. When the assumed γ equals the strength that generated the missing comments (the black rings), the estimate lands on the population value, and 95% intervals contain it 94–99% of the time. If positive comments go unwritten, γ = 1 gives mean tone of 0.30, 0.30, and 0.31 at 30%, 50%, and 80% missing; if workload complaints get written, γ = −1 gives a workload share of 26%, 26%, and 27%.
-
The data cannot tell which assumption is right, and a wrong one adds bias. The observed data are equally consistent with every value of γ. If comments are in fact missing at random and the analyst assumes γ = 1, mean tone comes out at 0.37, 0.42, and 0.48 instead of 0.30, and the workload share at 41%, 51%, and 66% instead of 26%.
-
When we cannot pin down why comments go missing, report a range of answers. One practical approach is to pick a plausible range of γ, compute the estimate and its 95% interval at each value, and report everything from the lowest lower limit to the highest upper limit (an uncertainty interval; Vansteelandt et al., 2006). With γ from −1 to 1, this range contained the population value in at least 97% of samples in every condition. The cost is precision. Even when comments were in fact missing at random, the reported range ran, on average, from:
| Comments missing |
Mean tone (population value 0.30) |
Share mentioning workload (population value 26%) |
| 30% |
0.13 to 0.44 |
16% to 45% |
| 50% |
0.07 to 0.49 |
12% to 55% |
| 80% |
−0.04 to 0.56 |
6% to 71% |
With 30% missing, the range still supports a conclusion such as “comments are positive on balance.” With 80% missing, it does not: tone could be slightly negative or clearly positive, and the workload share could be anywhere from 6% to 71%. Narrowing the range of γ is not a fix. With γ from −0.5 to 0.5, the ranges are tighter, but when the true strength was 1 and 80% of comments were missing, they contained the population tone only 54% of the time and the population workload share never. The range of γ should reflect what is known about who skips the comment box, not how precise one would like the answer to be.
Relationships hold up better than levels. How tone changes with the difficulty rating is much less sensitive to γ. Across γ from −1 to 1, the average slope stays between −0.21 and −0.25 at 30% and 50% missing (population value −0.25) and between −0.15 and −0.25 at 80%, so the estimate stays clearly negative under every assumption in that range: comments on harder courses are more negative.
From 2002 to 2008, RateMyProfessor allowed ratings without a comment (from 2009 on, every post in the sample has one). In those years, 9.4% of 10,327 posts had no comment, and less satisfied students skipped more often: 13.1% for quality ratings of 1–2 against 7.9% for 4–5. A 1 SD lower rating raised the log-odds of skipping by 0.29, controlling for difficulty and year. This is the opposite direction from the simulated “satisfied students skip” scenario and a weaker effect; because the corrections condition on the rating, the direction changes the sign of the bias, not whether it can be corrected.
How much could the unwritten comments change the summaries? The same sensitivity analysis, applied to these posts with 1,000 cluster-bootstrap resamples, gives the following estimates (comments from these years mention workload less often than later ones):
|
Written comments only |
Missing at random (γ = 0) |
Estimates for γ from −1 to 1 |
Estimates for γ from −2 to 2 |
| Mean tone |
0.30 |
0.28 |
0.25 to 0.31 |
0.22 to 0.33 |
| Share mentioning workload |
18.8% |
18.5% |
17.2% to 23.6% |
17.1% to 26.1% |

With fewer than one in ten comments missing, no assumption in this range changes the conclusions. Mean tone stays clearly positive; the correction for missing at random lowers it slightly (from 0.30 to 0.28) because less satisfied students skipped more often. The workload share cannot move far: even if none or all of the 967 missing comments had mentioned workload, the share would lie between 17.0% and 26.4%.
Takeaways
- Available ratings can rescue comment summaries only when they capture why people skip the comment box. Overall sentiment is largely recoverable from an overall rating; what people write about generally is not, unless the survey also asks a rating question on that topic.
- Before crediting a correction, check which predictor does the work. Here the quality rating alone accounts for the recovery of mean tone.
- Because people with something to say are plausibly the ones who write, topic prevalence in open-ended feedback deserves the most caution. A sensitivity analysis that reports estimates across plausible strengths of content-driven skipping shows when conclusions hold (as in the real data, with 9% of comments missing) and when the data cannot pin them down (as at high missing rates).
- Respondents nested within instructors, managers, or teams need cluster-aware intervals; correcting the bias with weights or imputation does not fix the uncertainty.
Limitations
- The workload measure misses about 40% of comments that discuss workload, so the results describe comments the measure flags rather than workload talk in general.
- The missingness mechanisms are simulated, with a fixed strength (1 SD = 1 log-odds); the real skipping pattern was weaker and in the opposite direction, which is worth exploring further.
- The cluster-aware imputation adds professor-level means to a single-level model rather than fitting a multilevel imputation model.
- The sensitivity analysis uses one estimator (weighting) and one form of selection (log-odds linear in the comment’s tone or workload mention). Which range of γ counts as plausible is a judgment, not an estimate.
- The data are a 20,000-post sample of a larger scrape, capped at 20 posts per professor, and RateMyProfessor users are not a random sample of students.
Reproducing the results
Requires Python 3.10+ and R 4.3+ (developed with Python 3.14 and R 4.6.2; R packages mice 3.19.0, dplyr, purrr, future, furrr, tibble, and ggplot2).
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python python/00_download_data.py # downloads the 20,000-post sample (about 11 MB)
python python/01_build_features.py # tone and workload measures (about 2 minutes on Apple silicon)
python python/02_sample_validation.py score # accuracy of the workload measure (needs the coded samples)
Rscript R/03_simulation.R full # about 2 hours on 7 cores
Rscript R/04_figures.R
Rscript R/05_sensitivity.R full # sensitivity analysis, about 12 minutes
Rscript R/06_sensitivity_figures.R
Rscript R/07_quality_check.R # what the quality rating contributes, about 9 minutes
python python/02_sample_validation.py draw draws the holdout sample for coding; it never overwrites coded files.
Data and licensing
- Comments: the RateMyProfessor sample (He, 2020) is released under CC BY 4.0, but the comments are students’ own writing and the file includes professor names, so comment text and comment-level files stay in
data/, which is not committed. The processed features contain only numbers, with professors replaced by integer IDs.
- Results: aggregate tables and simulation replications (estimates only).
Repository structure
python/00_download_data.py Download the RateMyProfessor sample
python/01_build_features.py Tone and workload measures (numbers only)
python/02_sample_validation.py Samples for checking the workload measure, and their accuracy
R/03_simulation.R Simulation
R/04_figures.R Figures
R/05_sensitivity.R Sensitivity analysis (simulation and real skipping)
R/06_sensitivity_figures.R Sensitivity figures
R/07_quality_check.R What the quality rating contributes
results/ Summary tables, replications, and validation accuracy
figures/ Figures shown above
References
- Field, C. A., & Welsh, A. H. (2007). Bootstrapping clustered data. Journal of the Royal Statistical Society: Series B, 69(3), 369–390.
- He, J. (2020). Big data set from RateMyProfessor.com for professors’ teaching evaluation (Version 2) [Data set]. Mendeley Data. https://doi.org/10.17632/fvtfjyvw7d.2
- Little, R. J. A., & Rubin, D. B. (2019). Statistical analysis with missing data (3rd ed.). Wiley.
- Loureiro, D., Barbieri, F., Neves, L., Espinosa Anke, L., & Camacho-Collados, J. (2022). TimeLMs: Diachronic language models from Twitter. Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, 251–260.
- Robins, J. M., Rotnitzky, A., & Zhao, L. P. (1994). Estimation of regression coefficients when some regressors are not always observed. Journal of the American Statistical Association, 89(427), 846–866.
- Rotnitzky, A., Robins, J. M., & Scharfstein, D. O. (1998). Semiparametric regression for repeated outcomes with nonignorable nonresponse. Journal of the American Statistical Association, 93(444), 1321–1339.
- Rubin, D. B. (1987). Multiple imputation for nonresponse in surveys. Wiley.
- van Buuren, S., & Groothuis-Oudshoorn, K. (2011). mice: Multivariate imputation by chained equations in R. Journal of Statistical Software, 45(3), 1–67.
- Vansteelandt, S., Goetghebeur, E., Kenward, M. G., & Molenberghs, G. (2006). Ignorance and uncertainty regions as inferential tools in a sensitivity analysis. Statistica Sinica, 16(3), 953–979.
License
Code is released under the MIT License (see LICENSE).
评论