I have created an stm topic model and I have issues with summary.estimateEffect, I have around 150 days, yet, it only prints 10 days for regression estimates.
parlPrevFit<- stm(document = out$documents, vocab = out$vocab, K = 0, prevalence =~s(day),
max.em.its = 150, data = out$meta, init.type = "Spectral")
prep<- estimateEffect(c(14, 40, 5, 41)~s(day), parlPrevFit, meta = meta, uncertainty = "Global")
summary(prep, topics = c(14, 40, 5, 41))
Topic 14 Coefficients- https://prnt.sc/105pg1a
Could anyone recommend any suggestions on how to print more than 10 days, please?
Instead of using
summary(), which you don't have much control over, load the tidytext package and usetidy()instead.Let's walk through an example where we train a topic model on Jane Austen's novels, with the documents being each chapter:
Let's train a topic model with 6 topics (there are 6 books):
Let's make a data set to use in
estimateEffect():Now let's estimate regressions from our topic model, for our first three topics and our data set of "chapter" documents:
This example doesn't have the problem you mentioned of printing limitations, but you can avoid any problem like that by using
tidy()instead where you get the actual content of the regressions out:Created on 2021-02-26 by the reprex package (v1.0.0)