Get the loadings from a DFA as a data frame
An optional vector of names for plotting the loadings.
Logical. Should the full posterior densities be returned? Defaults to
Confidence level for credible intervals. Defaults to 0.95.
A data frame with the following columns:
name is an identifier for each loading,
trend is the trend for the
median is the posterior median loading,
lower is the lower CI,
upper is the upper CI, and
prob_diff0 is the probability the loading is
different than 0. When
summary = FALSE, there is no
columns and instead there are columns
plot_loadings fit_dfa rotate_trends
1 2 3 4 5 6 7
set.seed(42) s <- sim_dfa(num_trends = 2, num_ts = 4, num_years = 10) # only 1 chain and 180 iterations used so example runs quickly: m <- fit_dfa(y = s$y_sim, num_trends = 2, iter = 50, chains = 1) r <- rotate_trends(m) loadings <- dfa_loadings(r, summary = TRUE) loadings <- dfa_loadings(r, summary = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.