Estimation of the Structural Topic and Sentiment-Discourse Model for Text Analysis

The Structural Topic and Sentiment-Discourse (STS) model allows researchers to estimate topic models with document-level metadata that determines both topic prevalence and sentiment-discourse. The sentiment-discourse is modeled as a document-level latent variable for each topic that modulates the word frequency within a topic. These latent topic sentiment-discourse variables are controlled by the document-level metadata. The STS model can be useful for regression analysis with text data in addition to topic modeling’s traditional use of descriptive analysis. The method was developed in Chen and Mankad (2024) .


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("sts")

1.4 by Shawn Mankad, 2 years ago


Browse source code at https://github.com/cran/sts


Authors: Shawn Mankad [aut, cre] , Li Chen [aut]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports glmnet, matrixStats, slam, foreach, doParallel, parallel, stm, Matrix, mvtnorm, ggplot2, tm

Suggests knitr, rmarkdown

Linking to Rcpp, RcppArmadillo


See at CRAN