summary method for class "hef".

# S3 method for hef
summary(
  object,
  ...,
  params = c("hyper", "pop"),
  which_pop = 1:ncol(object$theta_sim_vals)
)

Arguments

object

an object of class "hef", a result of a call to hef.

...

Additional arguments passed on to summary.ru.

params

A character scalar.

If params = "hyper" then the posterior samples of all hyperparameter values in \(\phi\) are summarized using summary.ru.

If params = "pop" then only posterior samples of the populations specified in which_pop are summarized.

which_pop

An integer vector. If params = "pop" then which_pop indicates which populations, i.e. which columns of object$theta_sim_vals to summarize, using summary. The default is all populations.

Examples

# Beta-binomial model, rat data
rat_res <- hef(model = "beta_binom", data = rat)

# Posterior summaries of the hyperparameters alpha and beta
summary(rat_res)
#> ru bounding box:  
#>                box       vals1       vals2 conv
#> a        1.0000000  0.00000000  0.00000000    0
#> b1minus -0.2382163 -0.40313465 -0.03906170    0
#> b2minus -0.2174510  0.05447431 -0.35297539    0
#> b1plus   0.2231876  0.36718396 -0.06551365    0
#> b2plus   0.2512577  0.05665707  0.44459818    0
#> 
#> estimated probability of acceptance:  
#> [1] 0.5319149
#> 
#> sample summary 
#>      alpha             beta       
#>  Min.   :0.8532   Min.   : 4.096  
#>  1st Qu.:1.8089   1st Qu.:10.633  
#>  Median :2.2092   Median :13.184  
#>  Mean   :2.3886   Mean   :14.189  
#>  3rd Qu.:2.7675   3rd Qu.:16.236  
#>  Max.   :8.3400   Max.   :47.163  

# Posterior summaries of the binomial probability for rats 1 to 3
summary(rat_res, params = "pop", which_pop = 1:3)
#>       p[1]               p[2]                p[3]         
#>  Min.   :0.001132   Min.   :0.0004883   Min.   :0.001653  
#>  1st Qu.:0.033226   1st Qu.:0.0334479   1st Qu.:0.031605  
#>  Median :0.055522   Median :0.0546231   Median :0.052928  
#>  Mean   :0.064163   Mean   :0.0634498   Mean   :0.061248  
#>  3rd Qu.:0.088311   3rd Qu.:0.0868917   3rd Qu.:0.083981  
#>  Max.   :0.276462   Max.   :0.2411408   Max.   :0.260752