Description Usage Arguments Details Value References Examples
A function to refit all the document loadings in an STM under an alternative content covariate level.
1 |
stm_model |
the stm content covariate model from which to develop the projection |
documents |
the documents that we want to refit. This currently only works if these are the original documents used to fit the model. However, this same refitting procedure could be done by using fitNewDocuments in the stm. |
content_level |
a string containing the level under which to refit the documents |
verbose |
a logical indicating if progress should be printed to the screen |
This function cycles through all the documents and refits the theta parameter (the document-topic loadings)
as though they all had the same level of the content covariate as specified by content_level
.
For documents that already had that content_level the results should be very close to their originally
learned value of theta if the model had converged. However, because stm is an iterative algorithm
and the global parameters are updated last, they could be different.
list
content_level |
the level of the content covariate |
theta |
the document-topic matrix refit under the new content level |
Roberts, M., Stewart, B., Nielsen, R. (2020) "Adjusting for Confounding with Text Matching." In American Journal of Political Science
1 2 | data(sim)
refitted <- refit(sim_topics, sim_documents, content_level="1")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.