R/bpc_get_parameters.R
get_parameters_table.Rd
Publication-ready table for the parameter estimates
get_parameters_table( bpc_object, params = NULL, credMass = 0.95, format = "latex", digits = 3, caption = "Parameters estimates", HPDI = T, n_eff = F, keep_par_name = T )
bpc_object | a bpc object |
---|---|
params | a vector with the parameters to be in the table. If NULL them all will be present |
credMass | the probability mass for the credible interval |
format | A character string. same formats utilized in the knitr::kable function
|
digits | number of digits in the table |
caption | a string containing the caption of the table |
HPDI | a boolean if the intervals should be credible (F) or HPD intervals (T) |
n_eff | a boolean. Should the number of effective samples be presented (T) or not (F default). |
keep_par_name | keep the parameter name e.g. lambda Graff instead of Graff. Default to T. Only valid for lambda, so we can have better ranks |
a formatted table
# \donttest{ m<-bpc(data = tennis_agresti, player0 = 'player0', player1 = 'player1', result_column = 'y', model_type = 'bt', solve_ties = 'none') #> Running MCMC with 4 parallel chains... #> #> Chain 1 finished in 3.0 seconds. #> Chain 2 finished in 3.1 seconds. #> Chain 4 finished in 3.1 seconds. #> Chain 3 finished in 3.2 seconds. #> #> All 4 chains finished successfully. #> Mean chain execution time: 3.1 seconds. #> Total execution time: 3.3 seconds. t<-get_parameters_table(m) print(t) #> \begin{table} #> #> \caption{Parameters estimates} #> \centering #> \begin{tabular}[t]{lrrrr} #> \toprule #> Parameter & Mean & Median & HPD\_lower & HPD\_higher\\ #> \midrule #> lambda[Seles] & 0.505 & 0.523 & -2.331 & 3.420\\ #> lambda[Graf] & 0.943 & 0.950 & -1.861 & 3.806\\ #> lambda[Sabatini] & -0.330 & -0.324 & -3.160 & 2.527\\ #> lambda[Navratilova] & 0.042 & 0.062 & -2.880 & 2.814\\ #> lambda[Sanchez] & -1.116 & -1.124 & -4.108 & 1.629\\ #> \bottomrule #> \end{tabular} #> \end{table} # }