Learn R Programming

stm (version 1.0.8)

sageLabels: Displays verbose labels that describe topics and topic-covariate groups in depth.

Description

For each topic or, when there is a covariate at the bottom of the model, for each topic-covariate group, sageLabels provides a list of the highest marginal probability words, the highest marginal FREX words, the highest marginal lift words, and the highest marginal score words, where marginal means it is summing over all potential covariates. It also provides each topic's Kappa (words associated with each topic) and baselined Kappa (baseline word distribution).

Usage

sageLabels(model, n=7)

Arguments

model
A fitted STM model object.
n
The number of words to print per topic/topic-covariate set. Default is 7.

Value

  • marginalA list of matrices, containing the high-probability labels, FREX labels, lift labels, and high scoring words.
  • KThe number of topics in the STM.
  • covnamesNames of the covariate values used in the STM.
  • kappaWords associated with topics, covariates, and topic/covariate interactions.
  • kappa.mBaseline word distribution.
  • nThe n parameter passed by the user to this function; number of words per topic or topic-covariate pair (when covariates are used on the bottom of the model)
  • cov.betasCovariate-specific beta matrices, listing for each covariate a matrix of highest-probability, FREX, lift, and high scoring words. Note that the actual vocabulary has been substituted for word indices.

Details

This can be used as an more detailed alternative to labelTopics.