View source: R/plotTopicLoess.R
plotTopicLoess | R Documentation |
Plots a loess line of the topic proportions on a covariate inputted by the user. This allows for a more flexible functional form for the relationship.
plotTopicLoess(
model,
topics,
covariate,
span = 1.5,
level = 0.95,
main = "",
xlab = "Covariate",
ylab = "Topic Proportions"
)
model |
An STM model object |
topics |
Vector of topic numbers to plot by the covariate. E.g., c(1,2,3) would plot lines for topics 1,2,3. |
covariate |
Covariate vector by which to plot topic proportions. |
span |
loess span parameter. See |
level |
Desired coverage for confidence intervals |
main |
Title of the plot, default is "" |
xlab |
X-label, default is "Covariate" |
ylab |
Y-label, default is "Topic Proportions" |
This function is considerably less developed than
plot.estimateEffect
and we recommend using that function with
splines and high degrees of freedom where possible. Computes standard
errors through the method of composition as in estimateEffect
.
plot.estimateEffect
plotTopicLoess(gadarianFit, topics=1, covariate=gadarian$pid_rep)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.