LessonThis is a lesson restated in new words. Any figure in it is an example from the source, not this desk's record.
On the calendar day of analyst recommendations, StockTwits sentiment and a buy-minus-sell spread moved together with a positive slope. In the lecture’s ordinary-least-squares printout the sentiment coefficient was about 32, the intercept about 6, and the t-statistic was positive and statistically significant. The r-squared was low enough that they call the line weak or moderate rather than strong. Nothing in the fit says the posts caused the ratings or the ratings caused the posts.
Why it matters
Both series come from Financial Modeling Prep, using your own key. One helper pulls analyst recommendations. The other pulls historical StockTwits sentiment, 100 pages in the lecture, from a saved frame so the slow query is not repeated. The lecture’s reason to care is practical and untested: a sentiment book might hold a name longer when ratings agree, or skip a name when they disagree, and either rule would change turnover. Those are uses they imagine. They are not results they measured.
Recommendations have a long literature on price impact, which the lecture mentions and does not re-estimate. The new object is the same-day pairing with social tone.
The idea in plain words
The recommendation helper collapses strong buy with buy, and strong sell with sell. The lecture does not use the “strong” distinction. The spread is total buys minus total sells. Positive means more buy-side ratings. Negative means more sell-side ratings. Dates are parsed so they can match the sentiment dates.
Sentiment timestamps are hourly. Recommendation timestamps, in the file they inspected, are daily. The lecture is careful about a different fact: daily granularity of the timestamp is not the same as daily publication. On the pulled frame the recommendations showed up on a monthly cadence, with successive months visible, while the date field itself had no hour. The merge is on that shared date and on the symbol.
Because sentiment is averaged over the recommendation’s date, the pairing mixes tone from around the release. The lecture calls it a blend. It is not a clean “before” and not a clean “after.” They list designs they did not run: a break around the release, cumulative abnormal tone, tone averaged over the prior week or month. Any of those would aim at a direction of influence. This page’s design does not.
The names are an arbitrary large-cap list spanning several industries, chosen so the API demo stays moderate. A fuller study, they say, would use something like the Russell 3000 or the S&P 500. Averaging sentiment by date and symbol, rather than by date alone, keeps one firm’s posts from being mixed with another’s.
The scatter resembles their earlier return scatter. Around a neutral sentiment near 0.5, recommendation spreads are both very large and very small. Away from that band, the cloud tilts up. A line with slope about 32 and intercept about 6 is the least-squares summary. Low r-squared and a low correlation are why “positive” does not mean “tight.”
How to use it
Rebuild the spread before you plot anything. If strong buys are left out of the buy total, you are not matching the lecture. Merge on date and symbol after sentiment has been averaged to the day. Then fit tone as the explanatory variable and the spread as the outcome if you want their printout. Quote the slope only with the r-squared. A slope near 32 with a weak fit means the line is a description of a noisy cloud, which is what they drew.
What usually goes wrong
Calling the t-statistic a cause is the main miss. The lecture repeats that the work is correlation, that there is no causal claim, and that even a predictive lag would still be statistical until a design isolates influence. Significant and weak can be true together. Their printout is that case.
Questions people ask
What did the regression report?
A sentiment coefficient around 32, an intercept around 6, a positive t-statistic they describe as statistically significant, and a low r-squared. They summarize that as a weak to moderate positive linear association on the recommendation day.
Are analyst ratings published every day in this file?
No. The lecture says the timestamp is a calendar date, while the rows they looked at were spaced monthly. Hourly stamps exist on the sentiment side and were averaged down to that date.
Can this fit tell you to hold a stock longer?
Not by itself. Longer holds when tone and ratings agree, or skipped trades when they disagree, are uses the lecture imagines for a later test. This fit does not measure turnover or returns.