plot_affect | R Documentation |
plot_affect
is capable of plotting either grouped or
individual-level posterior predictions (vs. raw observations) for a defined
list of posterior predictions and/or grouping.
plot_affect(
data,
plt_type = c("individual", "grouped", "weights"),
adj_order = c("happy", "confident", "engaged"),
nouns = c("Happiness", "Confidence", "Engagement"),
id_no = NULL,
r2_coords = c(0.9, 0.8),
cred = c(0.95, 0.99),
legend_pos = "right",
pal = NULL,
font = "",
font_size = 11
)
data |
Either a list of outputs from get_affect_ppc, or parameters from make_par_df. |
plt_type |
Possible types are "grouped" or "individual" (for get_affect_ppc outputs) or "weights" (for make_par_df output). |
adj_order |
Same as |
nouns |
Formatted noun versions of the adjectives, in order. |
id_no |
If |
r2_coords |
If |
cred |
Same as plot_glm, ignored unless |
legend_pos , pal , font , font_size |
Same as plot_import. |
A single or list of ggplot
object(s) depending on type.
## Not run:
fit_affect <- fit_learning_model(
example_data$nd,
model = "2a",
affect = TRUE,
exp_part = "training",
algorithm = "fullrank"
)
fit_dfs <- list()
for (adj in c("happy", "confident", "engaged")) {
fits_dfs[[adj]] <- get_affect_ppc(
fit_affect$draws, fit_affect$raw_df, adj = adj
)
}
# Grouped plot
plot_affect(fit_dfs, plt_type = "grouped")
# Individual-level median posterior predictions
plot_affect(fit_dfs, plt_type = "individual", r2_coords = c(0.8, 0.97))
# Weight plot
pars <- make_par_df(fit_affect$raw, fit_affect$summary)
plot_affect(pars, plt_type = "weights"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.