Refits the model many times with the treatment labels permuted, aligning
topics across refits, to build a null distribution for the treatment effect
on each topic (cf. stm::permutationTest). Fast because each refit is cheap.
Arguments
- formula
Prevalence formula whose RHS includes
treatment.- model
A faSTM fit.
- treatment
Name of a 0/1 covariate in
corpus$meta.- corpus
The
faSTM_corpusthe model was fit on.- nruns
Total models (1 reference +
nruns-1permutations).- seed
RNG seed.
- ...
Passed to
stm()for the refits.