bstewart / stm

An R Package for the Structural Topic Model
Other
401 stars 98 forks source link

Interpreting plot.estimateEffect output #179

Closed chitbazoo closed 5 years ago

chitbazoo commented 5 years ago

Hi Brandon,

I have been working with the stm package to estimate the effect of publication on topic prevalence -- studying how media coverage of the financial crisis varied between British newspaper in the immediate post-crisis era. I've been struggling to correctly interpret some of the output from the plot.estimateEffect(), and wondered if you could provide me with some guidance. I am very new to topic modeling, so I apologise if my description of what I am doing is unclear!

This is my code, modeling topic prevalence as a function of title and date, and content as a function of title, with K=5.

all_res_k5 <- stm(documents = out$documents, vocab = out$vocab,
                K=5, prevalence = ~ pubtitle_simplified + s(date),
                content = ~ pubtitle_simplified,
                max.em.its = 75, data = out$meta,
                seed=4511648,
                init.type = "Spectral")

k5.effect <- estimateEffect(1:5 ~ pubtitle_simplified + s(date),
                               all_res_k5,
                               meta=out$meta,
                               uncertainty="Global")

I have then generated two different plots using the plot.estimateEffect function, first plotting the mean estimated topic proportions for each publication (method="pointestimate") (Plot 1), and second plotting the mean difference in topic proportions between two publications, the Mirror and the Telegraph (method="difference") (Plot 2).

Plot 1: image

Plot 2: image

Am I right in interpreting the positive coefficient in Plot 2 as implying that the Mirror (cov.value=1) was relatively more likely to discuss the "Labour/Brown" topic than the Telegraph (cov.value=2) -- or is it the reverse? To me, this seems to be the interpretation that is consistent with Plot 1, but it is not obvious to me how to interpret this output based on the discussion of this function in the documentation.

santoshbs commented 1 year ago

@chitbazoo - your interpretation seems to be correct to me.