This function tests the relationship between a single topic or all topics and a variable of interest. Available tests include correlation, t-test, linear regression, binary regression, and ridge regression. (EXPERIMENTAL - under development)
textTopicsTest(
model,
pred_var,
group_var = NULL,
control_vars = c(),
test_method = "linear_regression",
multiple_comparison = "fdr",
load_dir = NULL
)
Metadata and results of the test such as estimate, t-value, p-value, and variable name.
(data.frame) The model returned from textTopics().
(string) Variable of interest for linear or binary regression
(string) Grouping variable for t-test
(list) Control variables for linear or binary regression
(string) Choose between "correlation", "t-test", "binary_regression", "linear_regression" or "ridge_regression"
Method for correction of multiple tests (e.g., "fdr", "bonferroni").
(string) if specified, the function returns the precomputed analysis from the directory, otherwise leave blank