stm1.3.7 package

Estimation of the Structural Topic Model

alignCorpus

Align the vocabulary of a new corpus to an old corpus

asSTMCorpus

STM Corpus Coercion

calcfrex

Calculate FREX (FRequency and EXclusivity) Words

calclift

Calculate Lift Words

calcscore

Calculate Score Words

checkBeta

Looks for words that load exclusively onto a topic

checkResiduals

Residual dispersion test for topic number

cloud

Plot a wordcloud

convertCorpus

Convert stm formatted documents to another format

estimateEffect

Estimates regressions using an STM object

exclusivity

Exclusivity

findThoughts

Find Thoughts

findTopic

Find topics that contain user specified words.

fitNewDocuments

Fit New Documents

js.estimate

A James-Stein Estimator Shrinking to a Uniform Distribution

labelTopics

Label topics

make.dt

Make a data.table of topic proportions.

make.heldout

Heldout Likelihood by Document Completion

makeDesignMatrix

Make a Design Matrix

manyTopics

Performs model selection across separate STM's that each assume differ...

multiSTM

Analyze Stability of Local STM Mode

optimizeDocument

Optimize Document

permutationTest

Permutation test of a binary covariate.

plot.estimateEffect

Plot effect of covariates on topics

plot.MultimodDiagnostic

Plotting Method for Multimodality Diagnostic Objects

plot.searchK

Plots diagnostic values resulting from searchK

plot.STM

Functions for plotting STM objects

plot.STMpermute

Plot an STM permutation test.

plot.topicCorr

Plot a topic correlation graph

plotModels

Plots semantic coherence and exclusivity for high likelihood models ou...

plotQuote

Plots strings

plotRemoved

Plot documents, words and tokens removed at various word thresholds

plotTopicLoess

Plot some effects with loess

prepDocuments

Prepare documents for analysis with stm

readCorpus

Read in a corpus file.

readLdac

Read in a .ldac Formatted File

rmvnorm

Draw from a Multivariate Normal

s

Make a B-spline Basis Function

sageLabels

Displays verbose labels that describe topics and topic-covariate group...

searchK

Computes diagnostic values for models with different values of K (numb...

selectModel

Assists the user in selecting the best STM model.

semanticCoherence

Semantic Coherence

stm-package

Structural Topic Model

stm

Variational EM for the Structural Topic Model

summary.estimateEffect

Summary for estimateEffect

summary.STM

Summary Function for the STM objects

textProcessor

Process a vector of raw texts

thetaPosterior

Draw from Theta Posterior

toLDAvis

Wrapper to launch LDAvis topic browser.

toLDAvisJson

Wrapper to create Json mapping for LDAvis. This can be useful in indir...

topicCorr

Estimate topic correlation

topicLasso

Plot predictions using topics

topicQuality

Plots semantic coherence and exclusivity for each topic.

unpack.glmnet

Unpack a glmnet object

writeLdac

Write a .ldac file

The Structural Topic Model (STM) allows researchers to estimate topic models with document-level covariates. The package also includes tools for model selection, visualization, and estimation of topic-covariate regressions. Methods developed in Roberts et. al. (2014) <doi:10.1111/ajps.12103> and Roberts et. al. (2016) <doi:10.1080/01621459.2016.1141684>. Vignette is Roberts et. al. (2019) <doi:10.18637/jss.v091.i02>.

  • Maintainer: Brandon Stewart
  • License: MIT + file LICENSE
  • Last published: 2023-12-01