summary_stat prints and saves summary statistics

summary_stat(
  combined,
  toprint = "all",
  groupby = "factor",
  meanSD = TRUE,
  quantiles = c(0.025, 0.25, 0.5, 0.75, 0.975),
  savetxt = TRUE,
  filename = "summary_statistics"
)

Arguments

combined

list, output from combine_sources function

toprint

vector, which parameters to print? Options are: "p" to print stats for proportions only (all factors), "global" to only print overall proportions, "fac1" to only print factor 1 proportions, "fac2" to print factor 2 proportions. Set = "epsilon" to print multiplicative error term only. Default = "all", prints stats for all model parameters.

groupby

character, group stats by "factor" or "source"? I.e. in wolves example, group proportions by Region 1, Region 2, Region 3 (groupby="factor") vs. Deer, Marine Mammals, Salmon (groupby="source"). Currently only "factor" is implemented.

meanSD

TRUE/FALSE, print mean and SD for the parameters?

quantiles

vector, which quantiles to print. Default = c(0.025, 0.25, 0.5, 0.75, 0.975).

savetxt

TRUE/FALSE, save results as .txt file (in working directory)?

filename

character, file name to save results as (.txt will be appended automatically)

See also

Examples

if (FALSE) { # first run mantis shrimp example # combine 6 sources into 2 groups of interest (hard-shelled vs. soft-bodied) # 'hard' = 'clam' + 'crab' + 'snail' # group 1 = hard-shelled prey # 'soft' = 'alphworm' + 'brittlestar' + 'fish' # group 2 = soft-bodied prey combined <- combine_sources(jags.1, mix, source, alpha.prior=alpha, groups=list(hard=c("clam","crab","snail"), soft=c("alphworm","brittlestar","fish"))) summary_stat(combined) summary_stat(combined, savetxt=FALSE) summary_stat(combined, meanSD=FALSE) summary_stat(combined, quantiles=c(.05,.5,.95)) summary_stat(combined, toprint="fac1") summary_stat(combined, toprint="p") summary_stat(combined, toprint="global") }