
Estimate topic prevalence effects from an STM model
Source:R/topic_modeling.R
estimate_topic_effects.RdEstimates how a document-level covariate shifts topic prevalence, returning a tidy data frame of per-topic estimates with intervals.
Arguments
- estimates
An
estimateEffectobject fromstm::estimateEffect.- variable
Name of the covariate to evaluate.
- type
"pointestimate" for a categorical covariate or "continuous" for a numeric one.
- method
"stm" (method of composition, default) or "beta" (bounded per-topic Beta regression).
- interval
"eti" equal-tailed (default for "stm") or "hpd" highest-posterior-density (default for "beta").
- model
Fitted
stmmodel; required formethod = "beta".- documents
Document list passed to
stm; required formethod = "beta".- npoints
Grid resolution for a continuous covariate (default 100).
- nsims
Posterior draws (default 100; 25 for
method = "beta").- ci
Interval width (default 0.95).