Learn R Programming

⚠️There's a newer version (1.3.8) of this package.Take me there.

stm (version 1.3.0)

Estimation of the Structural Topic Model

Description

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.

Copy Link

Version

Install

install.packages('stm')

Monthly Downloads

6,451

Version

1.3.0

License

MIT + file LICENSE

Maintainer

Brandon Stewart

Last Published

September 9th, 2017

Functions in stm (1.3.0)

calcfrex

Calculate FREX (FRequency and EXclusivity) Words
calclift

Calculate Lift Words
convertCorpus

Convert stm formatted documents to another format
estimateEffect

Estimates regressions using an STM object
checkResiduals

Residual dispersion test for topic number
cloud

Plot a wordcloud
calcscore

Calculate Score Words
checkBeta

Looks for words that load exclusively onto a topic
alignCorpus

Align the vocabulary of a new corpus to an old corpus
asSTMCorpus

STM Corpus Coercion
make.heldout

Heldout Likelihood by Document Completion
makeDesignMatrix

Make a Design Matrix
exclusivity

Exclusivity
findThoughts

Find Thoughts
manyTopics

Performs model selection across separate STM's that each assume different numbers of topics.
multiSTM

Analyze Stability of Local STM Mode
optimizeDocument

Optimize Document
permutationTest

Permutation test of a binary covariate.
rmvnorm

Draw from a Multivariate Normal
findTopic

Find topics that contain user specified words.
fitNewDocuments

Fit New Documents
plot.searchK

Plots diagnostic values resulting from searchK
s

Make a B-spline Basis Function
sageLabels

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

Computes diagnostic values for models with different values of K (number of topics).
topicLasso

Plot predictions using topics
topicQuality

Plots semantic coherence and exclusivity for each topic.
gadarian

Gadarian and Albertson data
js.estimate

A James-Stein Estimator Shrinking to a Uniform Distribution
plot.MultimodDiagnostic

Plotting Method for Multimodality Diagnostic Objects
plot.STM

Functions for plotting STM objects
readCorpus

Read in a corpus file.
readLdac

Read in a .ldac Formatted File
plotModels

Plots semantic coherence and exclusivity for high likelihood models outputted from selectModel.
plotQuote

Plots strings
selectModel

Assists the user in selecting the best STM model.
plot.topicCorr

Plot a topic correlation graph
plotRemoved

Plot documents, words and tokens removed at various word thresholds
plotTopicLoess

Plot some effects with loess
stm-package

Structural Topic Model
summary.STM

Summary Function for the STM objects
summary.estimateEffect

Summary for estimateEffect
toLDAvis

Wrapper to launch LDAvis topic browser.
topicCorr

Estimate topic correlation
semanticCoherence

Semantic Coherence
stm

Variational EM for the Structural Topic Model
unpack.glmnet

Unpack a glmnet object
writeLdac

Write a .ldac file
labelTopics

Label topics
make.dt

Make a data.table of topic proportions.
plot.STMpermute

Plot an STM permutation test.
plot.estimateEffect

Plot effect of covariates on topics
poliblog5k

CMU 2008 Political Blog Corpus
prepDocuments

Prepare documents for analysis with stm
textProcessor

Process a vector of raw texts
thetaPosterior

Draw from Theta Posterior