powered by
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" )
An STM model object
Vector of topic numbers to plot by the covariate. E.g., c(1,2,3) would plot lines for topics 1,2,3.
Covariate vector by which to plot topic proportions.
loess span parameter. See loess
loess
Desired coverage for confidence intervals
Title of the plot, default is ""
X-label, default is "Covariate"
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
estimateEffect
plotTopicLoess(gadarianFit, topics=1, covariate=gadarian$pid_rep)
Run the code above in your browser using DataLab