Example

This is a basic example which shows you how to solve a common problem:

library(shredder)
library(rstan)

Standard Output


Inference for Stan model: rats.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

                 mean se_mean    sd    2.5%     25%     50%     75%   97.5% n_eff Rhat
alpha[1]       239.94    0.03  2.65  234.72  238.13  239.94  241.73  245.15  7024    1
alpha[2]       247.80    0.04  2.74  242.30  246.01  247.86  249.64  253.05  6023    1
alpha[3]       252.44    0.04  2.58  247.22  250.74  252.43  254.13  257.50  5059    1
alpha[4]       232.60    0.03  2.71  227.23  230.81  232.61  234.38  237.94  7017    1
alpha[5]       231.64    0.03  2.69  226.32  229.85  231.62  233.46  236.90  6477    1
alpha[6]       249.75    0.04  2.65  244.39  248.04  249.75  251.49  255.06  5331    1
alpha[7]       228.70    0.03  2.69  223.51  226.94  228.64  230.42  234.05  7721    1
alpha[8]       248.33    0.04  2.65  243.23  246.52  248.28  250.12  253.61  5596    1
alpha[9]       283.27    0.04  2.68  277.83  281.53  283.28  285.08  288.40  5129    1
alpha[10]      219.27    0.03  2.62  213.97  217.53  219.26  221.05  224.29  6879    1
alpha[11]      258.26    0.03  2.71  252.87  256.49  258.27  260.03  263.85  6760    1
alpha[12]      228.14    0.03  2.74  222.81  226.28  228.09  229.98  233.68  7475    1
alpha[13]      242.41    0.03  2.71  237.15  240.63  242.41  244.15  247.83  6268    1
alpha[14]      268.28    0.04  2.74  262.85  266.42  268.30  270.08  273.56  6108    1
alpha[15]      242.79    0.04  2.69  237.54  241.00  242.82  244.60  248.01  5881    1
alpha[16]      245.30    0.03  2.64  240.14  243.58  245.29  247.01  250.63  6282    1
alpha[17]      232.21    0.04  2.68  226.95  230.44  232.21  233.99  237.44  5517    1
alpha[18]      240.47    0.03  2.72  235.21  238.65  240.47  242.28  245.80  6733    1
alpha[19]      253.76    0.04  2.68  248.54  252.00  253.79  255.54  259.13  5846    1
alpha[20]      241.68    0.03  2.70  236.43  239.86  241.68  243.50  246.96  6563    1
alpha[21]      248.52    0.04  2.67  243.26  246.71  248.56  250.26  253.88  5708    1
alpha[22]      225.29    0.03  2.62  220.21  223.53  225.30  227.03  230.43  6554    1
alpha[23]      228.52    0.03  2.71  223.31  226.76  228.52  230.31  233.96  7679    1
alpha[24]      245.13    0.04  2.64  239.73  243.39  245.12  246.86  250.35  5278    1
alpha[25]      234.51    0.03  2.60  229.37  232.81  234.48  236.24  239.55  5746    1
alpha[26]      254.00    0.03  2.66  248.81  252.22  254.02  255.77  259.24  6521    1
alpha[27]      254.33    0.03  2.65  249.18  252.47  254.30  256.17  259.45  7077    1
alpha[28]      243.00    0.04  2.65  237.95  241.27  243.02  244.68  248.30  5487    1
alpha[29]      217.90    0.03  2.70  212.52  216.02  217.86  219.73  223.26  6188    1
alpha[30]      241.38    0.03  2.60  236.25  239.60  241.41  243.14  246.33  6561    1
beta[1]          6.06    0.00  0.24    5.60    5.90    6.06    6.22    6.52  6351    1
beta[2]          7.05    0.00  0.26    6.54    6.88    7.05    7.22    7.54  6081    1
beta[3]          6.48    0.00  0.24    6.02    6.32    6.49    6.64    6.95  5675    1
beta[4]          5.34    0.00  0.26    4.82    5.17    5.34    5.52    5.85  5389    1
beta[5]          6.57    0.00  0.24    6.10    6.40    6.57    6.72    7.03  5753    1
beta[6]          6.18    0.00  0.24    5.69    6.01    6.18    6.34    6.67  5846    1
beta[7]          5.98    0.00  0.24    5.50    5.81    5.97    6.14    6.45  6277    1
beta[8]          6.42    0.00  0.25    5.93    6.25    6.42    6.58    6.91  5725    1
beta[9]          7.06    0.00  0.26    6.56    6.88    7.06    7.23    7.55  5306    1
beta[10]         5.85    0.00  0.24    5.37    5.69    5.85    6.02    6.32  5511    1
beta[11]         6.80    0.00  0.25    6.31    6.63    6.80    6.97    7.29  5720    1
beta[12]         6.12    0.00  0.25    5.63    5.95    6.12    6.29    6.60  5937    1
beta[13]         6.16    0.00  0.24    5.69    6.00    6.16    6.33    6.61  6602    1
beta[14]         6.69    0.00  0.25    6.20    6.52    6.69    6.86    7.17  6294    1
beta[15]         5.42    0.00  0.24    4.93    5.26    5.42    5.58    5.89  5773    1
beta[16]         5.93    0.00  0.24    5.44    5.76    5.93    6.08    6.40  6010    1
beta[17]         6.27    0.00  0.23    5.82    6.12    6.27    6.43    6.73  4764    1
beta[18]         5.84    0.00  0.25    5.35    5.68    5.85    6.01    6.34  5926    1
beta[19]         6.41    0.00  0.24    5.94    6.24    6.41    6.56    6.88  6205    1
beta[20]         6.05    0.00  0.24    5.59    5.90    6.05    6.21    6.51  6409    1
beta[21]         6.41    0.00  0.25    5.92    6.24    6.41    6.57    6.89  6100    1
beta[22]         5.86    0.00  0.23    5.41    5.70    5.86    6.01    6.31  6723    1
beta[23]         5.75    0.00  0.24    5.28    5.58    5.74    5.90    6.21  5846    1
beta[24]         5.89    0.00  0.24    5.42    5.73    5.89    6.05    6.37  6067    1
beta[25]         6.91    0.00  0.26    6.40    6.74    6.91    7.09    7.42  5229    1
beta[26]         6.55    0.00  0.24    6.08    6.39    6.55    6.71    7.02  5256    1
beta[27]         5.90    0.00  0.24    5.42    5.73    5.90    6.06    6.37  6120    1
beta[28]         5.85    0.00  0.24    5.37    5.68    5.85    6.01    6.32  5674    1
beta[29]         5.67    0.00  0.24    5.19    5.51    5.67    5.83    6.15  7156    1
beta[30]         6.14    0.00  0.25    5.66    5.97    6.14    6.30    6.62  6008    1
mu_alpha       242.45    0.04  2.68  237.17  240.65  242.43  244.22  247.79  5295    1
mu_beta          6.19    0.00  0.11    5.98    6.11    6.19    6.26    6.40  4302    1
sigmasq_y       37.19    0.13  5.68   27.60   33.20   36.71   40.67   49.83  1942    1
sigmasq_alpha  216.80    1.00 63.46  124.16  173.10  205.47  249.85  371.18  4027    1
sigmasq_beta     0.27    0.00  0.10    0.13    0.21    0.26    0.33    0.51  3640    1
sigma_y          6.08    0.01  0.46    5.25    5.76    6.06    6.38    7.06  1963    1
sigma_alpha     14.58    0.03  2.06   11.14   13.16   14.33   15.81   19.27  4324    1
sigma_beta       0.52    0.00  0.09    0.36    0.45    0.51    0.57    0.72  3579    1
alpha0         106.36    0.05  3.53   99.55  104.01  106.36  108.69  113.32  4815    1
lp__          -438.05    0.23  7.05 -453.46 -442.45 -437.57 -433.16 -425.80   978    1

Samples were drawn using NUTS(diag_e) at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).


The Stan Script


Pars

Names

 [1] "alpha"         "beta"          "mu_alpha"      "mu_beta"       "sigmasq_y"    
 [6] "sigmasq_alpha" "sigmasq_beta"  "sigma_y"       "sigma_alpha"   "sigma_beta"   
[11] "alpha0"        "lp__"         
rats%>%
  stan_names(expand = TRUE)
 [1] "alpha[1]"      "alpha[2]"      "alpha[3]"      "alpha[4]"      "alpha[5]"     
 [6] "alpha[6]"      "alpha[7]"      "alpha[8]"      "alpha[9]"      "alpha[10]"    
[11] "alpha[11]"     "alpha[12]"     "alpha[13]"     "alpha[14]"     "alpha[15]"    
[16] "alpha[16]"     "alpha[17]"     "alpha[18]"     "alpha[19]"     "alpha[20]"    
[21] "alpha[21]"     "alpha[22]"     "alpha[23]"     "alpha[24]"     "alpha[25]"    
[26] "alpha[26]"     "alpha[27]"     "alpha[28]"     "alpha[29]"     "alpha[30]"    
[31] "beta[1]"       "beta[2]"       "beta[3]"       "beta[4]"       "beta[5]"      
[36] "beta[6]"       "beta[7]"       "beta[8]"       "beta[9]"       "beta[10]"     
[41] "beta[11]"      "beta[12]"      "beta[13]"      "beta[14]"      "beta[15]"     
[46] "beta[16]"      "beta[17]"      "beta[18]"      "beta[19]"      "beta[20]"     
[51] "beta[21]"      "beta[22]"      "beta[23]"      "beta[24]"      "beta[25]"     
[56] "beta[26]"      "beta[27]"      "beta[28]"      "beta[29]"      "beta[30]"     
[61] "mu_alpha"      "mu_beta"       "sigmasq_y"     "sigmasq_alpha" "sigmasq_beta" 
[66] "sigma_y"       "sigma_alpha"   "sigma_beta"    "alpha0"        "lp__"         

Select

Inference for Stan model: rats.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

           mean se_mean   sd   2.5%    25%    50%    75%  97.5% n_eff Rhat
mu_alpha 242.45    0.04 2.68 237.17 240.65 242.43 244.22 247.79  5295    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).
rats%>%
  stan_select(mu_alpha,mu_beta)
Inference for Stan model: rats.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

           mean se_mean   sd   2.5%    25%    50%    75%  97.5% n_eff Rhat
mu_alpha 242.45    0.04 2.68 237.17 240.65 242.43 244.22 247.79  5295    1
mu_beta    6.19    0.00 0.11   5.98   6.11   6.19   6.26   6.40  4302    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).
rats%>%
  stan_select(!!!rlang::syms(c('mu_alpha','mu_beta')))
Inference for Stan model: rats.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

           mean se_mean   sd   2.5%    25%    50%    75%  97.5% n_eff Rhat
mu_alpha 242.45    0.04 2.68 237.17 240.65 242.43 244.22 247.79  5295    1
mu_beta    6.19    0.00 0.11   5.98   6.11   6.19   6.26   6.40  4302    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).
rats%>%
  stan_select(alpha[1],alpha[2])
Inference for Stan model: rats.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

           mean se_mean   sd   2.5%    25%    50%    75%  97.5% n_eff Rhat
alpha[1] 239.94    0.03 2.65 234.72 238.13 239.94 241.73 245.15  7024    1
alpha[2] 247.80    0.04 2.74 242.30 246.01 247.86 249.64 253.05  6023    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).
rats%>%
  stan_select(!!!rlang::syms(sprintf('alpha[%s]',1:5)))
Inference for Stan model: rats.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

           mean se_mean   sd   2.5%    25%    50%    75%  97.5% n_eff Rhat
alpha[1] 239.94    0.03 2.65 234.72 238.13 239.94 241.73 245.15  7024    1
alpha[2] 247.80    0.04 2.74 242.30 246.01 247.86 249.64 253.05  6023    1
alpha[3] 252.44    0.04 2.58 247.22 250.74 252.43 254.13 257.50  5059    1
alpha[4] 232.60    0.03 2.71 227.23 230.81 232.61 234.38 237.94  7017    1
alpha[5] 231.64    0.03 2.69 226.32 229.85 231.62 233.46 236.90  6477    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).

Select with Partials

Select all Parameters that contain “alpha”


Inference for Stan model: rats.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

                mean se_mean    sd   2.5%    25%    50%    75%  97.5% n_eff Rhat
alpha[1]      239.94    0.03  2.65 234.72 238.13 239.94 241.73 245.15  7024    1
alpha[2]      247.80    0.04  2.74 242.30 246.01 247.86 249.64 253.05  6023    1
alpha[3]      252.44    0.04  2.58 247.22 250.74 252.43 254.13 257.50  5059    1
alpha[4]      232.60    0.03  2.71 227.23 230.81 232.61 234.38 237.94  7017    1
alpha[5]      231.64    0.03  2.69 226.32 229.85 231.62 233.46 236.90  6477    1
alpha[6]      249.75    0.04  2.65 244.39 248.04 249.75 251.49 255.06  5331    1
alpha[7]      228.70    0.03  2.69 223.51 226.94 228.64 230.42 234.05  7721    1
alpha[8]      248.33    0.04  2.65 243.23 246.52 248.28 250.12 253.61  5596    1
alpha[9]      283.27    0.04  2.68 277.83 281.53 283.28 285.08 288.40  5129    1
alpha[10]     219.27    0.03  2.62 213.97 217.53 219.26 221.05 224.29  6879    1
alpha[11]     258.26    0.03  2.71 252.87 256.49 258.27 260.03 263.85  6760    1
alpha[12]     228.14    0.03  2.74 222.81 226.28 228.09 229.98 233.68  7475    1
alpha[13]     242.41    0.03  2.71 237.15 240.63 242.41 244.15 247.83  6268    1
alpha[14]     268.28    0.04  2.74 262.85 266.42 268.30 270.08 273.56  6108    1
alpha[15]     242.79    0.04  2.69 237.54 241.00 242.82 244.60 248.01  5881    1
alpha[16]     245.30    0.03  2.64 240.14 243.58 245.29 247.01 250.63  6282    1
alpha[17]     232.21    0.04  2.68 226.95 230.44 232.21 233.99 237.44  5517    1
alpha[18]     240.47    0.03  2.72 235.21 238.65 240.47 242.28 245.80  6733    1
alpha[19]     253.76    0.04  2.68 248.54 252.00 253.79 255.54 259.13  5846    1
alpha[20]     241.68    0.03  2.70 236.43 239.86 241.68 243.50 246.96  6563    1
alpha[21]     248.52    0.04  2.67 243.26 246.71 248.56 250.26 253.88  5708    1
alpha[22]     225.29    0.03  2.62 220.21 223.53 225.30 227.03 230.43  6554    1
alpha[23]     228.52    0.03  2.71 223.31 226.76 228.52 230.31 233.96  7679    1
alpha[24]     245.13    0.04  2.64 239.73 243.39 245.12 246.86 250.35  5278    1
alpha[25]     234.51    0.03  2.60 229.37 232.81 234.48 236.24 239.55  5746    1
alpha[26]     254.00    0.03  2.66 248.81 252.22 254.02 255.77 259.24  6521    1
alpha[27]     254.33    0.03  2.65 249.18 252.47 254.30 256.17 259.45  7077    1
alpha[28]     243.00    0.04  2.65 237.95 241.27 243.02 244.68 248.30  5487    1
alpha[29]     217.90    0.03  2.70 212.52 216.02 217.86 219.73 223.26  6188    1
alpha[30]     241.38    0.03  2.60 236.25 239.60 241.41 243.14 246.33  6561    1
mu_alpha      242.45    0.04  2.68 237.17 240.65 242.43 244.22 247.79  5295    1
sigmasq_alpha 216.80    1.00 63.46 124.16 173.10 205.47 249.85 371.18  4027    1
sigma_alpha    14.58    0.03  2.06  11.14  13.16  14.33  15.81  19.27  4324    1
alpha0        106.36    0.05  3.53  99.55 104.01 106.36 108.69 113.32  4815    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).


Inference for Stan model: rats.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

           mean se_mean   sd   2.5%    25%    50%    75%  97.5% n_eff Rhat
alpha[1] 239.94    0.03 2.65 234.72 238.13 239.94 241.73 245.15  7024    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).
rats%>%
  stan_select(stan_contains('alpha\\[[1-9]\\]'))
Inference for Stan model: rats.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

           mean se_mean   sd   2.5%    25%    50%    75%  97.5% n_eff Rhat
alpha[1] 239.94    0.03 2.65 234.72 238.13 239.94 241.73 245.15  7024    1
alpha[2] 247.80    0.04 2.74 242.30 246.01 247.86 249.64 253.05  6023    1
alpha[3] 252.44    0.04 2.58 247.22 250.74 252.43 254.13 257.50  5059    1
alpha[4] 232.60    0.03 2.71 227.23 230.81 232.61 234.38 237.94  7017    1
alpha[5] 231.64    0.03 2.69 226.32 229.85 231.62 233.46 236.90  6477    1
alpha[6] 249.75    0.04 2.65 244.39 248.04 249.75 251.49 255.06  5331    1
alpha[7] 228.70    0.03 2.69 223.51 226.94 228.64 230.42 234.05  7721    1
alpha[8] 248.33    0.04 2.65 243.23 246.52 248.28 250.12 253.61  5596    1
alpha[9] 283.27    0.04 2.68 277.83 281.53 283.28 285.08 288.40  5129    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).
Inference for Stan model: rats.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

         mean se_mean   sd  2.5%    25%    50%    75%  97.5% n_eff Rhat
alpha0 106.36    0.05 3.53 99.55 104.01 106.36 108.69 113.32  4815    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).
rats%>%
  stan_select(mu_alpha,stan_ends_with('0'),beta[1])
Inference for Stan model: rats.
4 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=4000.

           mean se_mean   sd   2.5%    25%    50%    75%  97.5% n_eff Rhat
beta[1]    6.06    0.00 0.24   5.60   5.90   6.06   6.22   6.52  6351    1
mu_alpha 242.45    0.04 2.68 237.17 240.65 242.43 244.22 247.79  5295    1
alpha0   106.36    0.05 3.53  99.55 104.01 106.36 108.69 113.32  4815    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).

Post-warmup samples

Subsetting post warmup samples

  rats%>%
    stan_slice(1:50,inc_warmup = TRUE)

First 50 with warmup samples


Inference for Stan model: rats.
4 chains, each with iter=1050; warmup=1000; thin=1; 
post-warmup draws per chain=50, total post-warmup draws=200.

                 mean se_mean    sd    2.5%     25%     50%     75%   97.5% n_eff Rhat
alpha[1]       239.96    0.17  2.84  234.50  237.70  240.19  242.10  244.84   273 0.99
alpha[2]       247.54    0.22  3.09  240.61  245.57  247.86  249.84  252.59   195 0.99
alpha[3]       252.42    0.18  2.50  247.03  250.87  252.39  253.99  256.97   196 1.00
alpha[4]       232.65    0.12  2.47  227.66  231.07  232.77  234.37  237.25   414 0.99
alpha[5]       231.49    0.13  2.79  226.34  229.48  231.15  233.66  236.63   460 1.00
alpha[6]       250.02    0.12  2.63  245.07  248.32  249.98  251.73  255.01   460 0.99
alpha[7]       228.70    0.12  2.51  224.17  226.88  228.56  230.64  233.38   460 0.99
alpha[8]       248.36    0.15  2.57  243.14  246.60  248.33  250.08  252.89   303 0.99
alpha[9]       283.21    0.17  2.27  279.00  281.78  283.13  284.70  287.56   182 1.02
alpha[10]      219.19    0.17  2.61  214.20  217.75  219.13  220.85  223.62   222 1.00
alpha[11]      258.46    0.14  2.93  252.46  256.47  258.51  260.33  264.59   460 0.99
alpha[12]      228.27    0.13  2.85  223.29  226.13  228.26  230.48  233.82   449 0.98
alpha[13]      242.40    0.14  2.97  237.04  240.46  242.32  244.26  249.49   437 0.99
alpha[14]      267.93    0.17  2.46  262.66  266.26  267.82  269.74  272.19   209 1.01
alpha[15]      242.84    0.14  2.90  237.51  240.82  242.82  244.73  248.55   460 0.99
alpha[16]      245.18    0.18  2.42  240.17  243.71  245.19  246.68  250.28   184 1.01
alpha[17]      232.32    0.16  2.75  226.65  230.23  232.52  234.07  237.60   304 1.00
alpha[18]      240.51    0.16  2.59  235.46  239.09  240.45  242.06  245.85   263 0.99
alpha[19]      253.92    0.14  2.78  249.16  251.76  253.96  255.60  260.18   409 0.99
alpha[20]      241.77    0.12  2.51  237.37  239.98  241.86  243.62  246.79   460 0.98
alpha[21]      248.42    0.15  2.46  243.99  246.67  248.50  249.82  252.96   277 0.99
alpha[22]      225.31    0.14  2.49  219.93  223.90  225.36  226.91  229.80   312 1.00
alpha[23]      228.38    0.12  2.37  223.67  226.72  228.47  230.07  232.54   408 0.99
alpha[24]      245.02    0.18  2.99  238.96  243.11  245.16  246.79  251.14   264 0.99
alpha[25]      234.44    0.16  2.86  228.80  232.39  234.59  236.31  240.37   336 0.99
alpha[26]      253.82    0.14  2.89  248.28  251.85  253.87  255.49  259.71   400 0.99
alpha[27]      254.40    0.14  2.63  249.40  252.75  254.41  256.20  260.23   350 0.99
alpha[28]      243.10    0.12  2.62  237.65  241.73  243.24  244.57  248.58   460 0.99
alpha[29]      217.96    0.15  2.34  213.73  216.10  218.03  219.35  222.49   228 1.00
alpha[30]      241.23    0.16  2.65  235.82  239.57  241.16  242.91  246.34   283 0.98
beta[1]          6.08    0.01  0.20    5.74    5.96    6.07    6.21    6.47   375 0.99
beta[2]          7.05    0.01  0.24    6.55    6.86    7.06    7.22    7.50   382 0.99
beta[3]          6.49    0.01  0.24    6.00    6.32    6.50    6.65    6.93   324 0.99
beta[4]          5.33    0.02  0.27    4.82    5.15    5.35    5.51    5.85   242 1.00
beta[5]          6.56    0.01  0.25    6.08    6.38    6.55    6.71    7.13   397 0.99
beta[6]          6.16    0.01  0.22    5.71    6.02    6.18    6.30    6.60   398 0.99
beta[7]          5.95    0.01  0.22    5.57    5.80    5.95    6.08    6.43   376 0.99
beta[8]          6.39    0.01  0.28    5.81    6.23    6.41    6.58    6.92   460 0.99
beta[9]          7.06    0.02  0.26    6.58    6.87    7.08    7.26    7.50   288 0.99
beta[10]         5.83    0.01  0.25    5.32    5.68    5.80    6.02    6.28   384 1.01
beta[11]         6.81    0.01  0.22    6.40    6.66    6.82    6.95    7.20   245 0.99
beta[12]         6.11    0.01  0.26    5.65    5.93    6.09    6.28    6.69   306 0.99
beta[13]         6.15    0.02  0.26    5.70    5.94    6.18    6.35    6.59   248 0.98
beta[14]         6.67    0.01  0.25    6.16    6.52    6.65    6.83    7.19   366 0.99
beta[15]         5.42    0.01  0.28    4.87    5.19    5.45    5.60    5.96   388 0.99
beta[16]         5.94    0.01  0.24    5.43    5.77    5.94    6.10    6.44   371 0.99
beta[17]         6.27    0.01  0.22    5.91    6.11    6.24    6.41    6.72   293 0.99
beta[18]         5.85    0.02  0.26    5.38    5.69    5.84    6.04    6.31   301 1.00
beta[19]         6.41    0.02  0.27    5.89    6.25    6.40    6.58    6.92   285 0.99
beta[20]         6.07    0.01  0.26    5.60    5.91    6.07    6.24    6.59   460 0.98
beta[21]         6.42    0.01  0.22    5.95    6.30    6.42    6.55    6.88   331 0.99
beta[22]         5.87    0.01  0.25    5.40    5.71    5.88    6.04    6.35   306 1.00
beta[23]         5.75    0.01  0.22    5.32    5.57    5.75    5.90    6.18   253 1.01
beta[24]         5.90    0.02  0.27    5.40    5.75    5.89    6.07    6.41   254 1.00
beta[25]         6.90    0.02  0.27    6.42    6.70    6.90    7.09    7.42   299 1.00
beta[26]         6.56    0.01  0.21    6.17    6.40    6.58    6.71    6.95   377 0.99
beta[27]         5.88    0.01  0.24    5.40    5.74    5.88    6.05    6.29   299 1.00
beta[28]         5.85    0.01  0.26    5.36    5.69    5.85    6.02    6.32   303 0.99
beta[29]         5.69    0.02  0.29    5.12    5.50    5.68    5.87    6.23   325 0.98
beta[30]         6.14    0.01  0.28    5.66    5.92    6.13    6.36    6.64   408 0.99
mu_alpha       242.33    0.16  2.51  236.55  240.80  242.34  244.04  246.96   247 1.00
mu_beta          6.18    0.01  0.10    5.99    6.11    6.18    6.25    6.41   161 1.00
sigmasq_y       37.46    0.40  5.38   28.83   34.03   36.89   40.43   49.85   182 1.00
sigmasq_alpha  207.48    3.81 54.89  123.70  166.68  197.83  236.64  322.38   208 1.01
sigmasq_beta     0.28    0.01  0.09    0.13    0.21    0.27    0.33    0.47   198 1.00
sigma_y          6.10    0.03  0.43    5.37    5.83    6.07    6.36    7.06   183 1.00
sigma_alpha     14.29    0.13  1.84   11.12   12.91   14.07   15.38   17.95   207 1.01
sigma_beta       0.52    0.01  0.09    0.37    0.46    0.52    0.58    0.69   191 1.00
alpha0         106.34    0.25  3.52   99.36  104.14  106.51  108.60  112.41   205 0.99
lp__          -438.55    0.82  6.57 -451.07 -442.73 -438.49 -434.54 -425.79    65 1.05

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).


  rats%>%
    stan_slice(1:50,inc_warmup = FALSE)

First 50 draws from each chain without warmup samples


Inference for Stan model: rats.
4 chains, each with iter=50; warmup=0; thin=1; 
post-warmup draws per chain=50, total post-warmup draws=200.

                 mean se_mean    sd    2.5%     25%     50%     75%   97.5% n_eff Rhat
alpha[1]       239.96    0.17  2.84  234.50  237.70  240.19  242.10  244.84   273 0.99
alpha[2]       247.54    0.22  3.09  240.61  245.57  247.86  249.84  252.59   195 0.99
alpha[3]       252.42    0.18  2.50  247.03  250.87  252.39  253.99  256.97   196 1.00
alpha[4]       232.65    0.12  2.47  227.66  231.07  232.77  234.37  237.25   414 0.99
alpha[5]       231.49    0.13  2.79  226.34  229.48  231.15  233.66  236.63   460 1.00
alpha[6]       250.02    0.12  2.63  245.07  248.32  249.98  251.73  255.01   460 0.99
alpha[7]       228.70    0.12  2.51  224.17  226.88  228.56  230.64  233.38   460 0.99
alpha[8]       248.36    0.15  2.57  243.14  246.60  248.33  250.08  252.89   303 0.99
alpha[9]       283.21    0.17  2.27  279.00  281.78  283.13  284.70  287.56   182 1.02
alpha[10]      219.19    0.17  2.61  214.20  217.75  219.13  220.85  223.62   222 1.00
alpha[11]      258.46    0.14  2.93  252.46  256.47  258.51  260.33  264.59   460 0.99
alpha[12]      228.27    0.13  2.85  223.29  226.13  228.26  230.48  233.82   449 0.98
alpha[13]      242.40    0.14  2.97  237.04  240.46  242.32  244.26  249.49   437 0.99
alpha[14]      267.93    0.17  2.46  262.66  266.26  267.82  269.74  272.19   209 1.01
alpha[15]      242.84    0.14  2.90  237.51  240.82  242.82  244.73  248.55   460 0.99
alpha[16]      245.18    0.18  2.42  240.17  243.71  245.19  246.68  250.28   184 1.01
alpha[17]      232.32    0.16  2.75  226.65  230.23  232.52  234.07  237.60   304 1.00
alpha[18]      240.51    0.16  2.59  235.46  239.09  240.45  242.06  245.85   263 0.99
alpha[19]      253.92    0.14  2.78  249.16  251.76  253.96  255.60  260.18   409 0.99
alpha[20]      241.77    0.12  2.51  237.37  239.98  241.86  243.62  246.79   460 0.98
alpha[21]      248.42    0.15  2.46  243.99  246.67  248.50  249.82  252.96   277 0.99
alpha[22]      225.31    0.14  2.49  219.93  223.90  225.36  226.91  229.80   312 1.00
alpha[23]      228.38    0.12  2.37  223.67  226.72  228.47  230.07  232.54   408 0.99
alpha[24]      245.02    0.18  2.99  238.96  243.11  245.16  246.79  251.14   264 0.99
alpha[25]      234.44    0.16  2.86  228.80  232.39  234.59  236.31  240.37   336 0.99
alpha[26]      253.82    0.14  2.89  248.28  251.85  253.87  255.49  259.71   400 0.99
alpha[27]      254.40    0.14  2.63  249.40  252.75  254.41  256.20  260.23   350 0.99
alpha[28]      243.10    0.12  2.62  237.65  241.73  243.24  244.57  248.58   460 0.99
alpha[29]      217.96    0.15  2.34  213.73  216.10  218.03  219.35  222.49   228 1.00
alpha[30]      241.23    0.16  2.65  235.82  239.57  241.16  242.91  246.34   283 0.98
beta[1]          6.08    0.01  0.20    5.74    5.96    6.07    6.21    6.47   375 0.99
beta[2]          7.05    0.01  0.24    6.55    6.86    7.06    7.22    7.50   382 0.99
beta[3]          6.49    0.01  0.24    6.00    6.32    6.50    6.65    6.93   324 0.99
beta[4]          5.33    0.02  0.27    4.82    5.15    5.35    5.51    5.85   242 1.00
beta[5]          6.56    0.01  0.25    6.08    6.38    6.55    6.71    7.13   397 0.99
beta[6]          6.16    0.01  0.22    5.71    6.02    6.18    6.30    6.60   398 0.99
beta[7]          5.95    0.01  0.22    5.57    5.80    5.95    6.08    6.43   376 0.99
beta[8]          6.39    0.01  0.28    5.81    6.23    6.41    6.58    6.92   460 0.99
beta[9]          7.06    0.02  0.26    6.58    6.87    7.08    7.26    7.50   288 0.99
beta[10]         5.83    0.01  0.25    5.32    5.68    5.80    6.02    6.28   384 1.01
beta[11]         6.81    0.01  0.22    6.40    6.66    6.82    6.95    7.20   245 0.99
beta[12]         6.11    0.01  0.26    5.65    5.93    6.09    6.28    6.69   306 0.99
beta[13]         6.15    0.02  0.26    5.70    5.94    6.18    6.35    6.59   248 0.98
beta[14]         6.67    0.01  0.25    6.16    6.52    6.65    6.83    7.19   366 0.99
beta[15]         5.42    0.01  0.28    4.87    5.19    5.45    5.60    5.96   388 0.99
beta[16]         5.94    0.01  0.24    5.43    5.77    5.94    6.10    6.44   371 0.99
beta[17]         6.27    0.01  0.22    5.91    6.11    6.24    6.41    6.72   293 0.99
beta[18]         5.85    0.02  0.26    5.38    5.69    5.84    6.04    6.31   301 1.00
beta[19]         6.41    0.02  0.27    5.89    6.25    6.40    6.58    6.92   285 0.99
beta[20]         6.07    0.01  0.26    5.60    5.91    6.07    6.24    6.59   460 0.98
beta[21]         6.42    0.01  0.22    5.95    6.30    6.42    6.55    6.88   331 0.99
beta[22]         5.87    0.01  0.25    5.40    5.71    5.88    6.04    6.35   306 1.00
beta[23]         5.75    0.01  0.22    5.32    5.57    5.75    5.90    6.18   253 1.01
beta[24]         5.90    0.02  0.27    5.40    5.75    5.89    6.07    6.41   254 1.00
beta[25]         6.90    0.02  0.27    6.42    6.70    6.90    7.09    7.42   299 1.00
beta[26]         6.56    0.01  0.21    6.17    6.40    6.58    6.71    6.95   377 0.99
beta[27]         5.88    0.01  0.24    5.40    5.74    5.88    6.05    6.29   299 1.00
beta[28]         5.85    0.01  0.26    5.36    5.69    5.85    6.02    6.32   303 0.99
beta[29]         5.69    0.02  0.29    5.12    5.50    5.68    5.87    6.23   325 0.98
beta[30]         6.14    0.01  0.28    5.66    5.92    6.13    6.36    6.64   408 0.99
mu_alpha       242.33    0.16  2.51  236.55  240.80  242.34  244.04  246.96   247 1.00
mu_beta          6.18    0.01  0.10    5.99    6.11    6.18    6.25    6.41   161 1.00
sigmasq_y       37.46    0.40  5.38   28.83   34.03   36.89   40.43   49.85   182 1.00
sigmasq_alpha  207.48    3.81 54.89  123.70  166.68  197.83  236.64  322.38   208 1.01
sigmasq_beta     0.28    0.01  0.09    0.13    0.21    0.27    0.33    0.47   198 1.00
sigma_y          6.10    0.03  0.43    5.37    5.83    6.07    6.36    7.06   183 1.00
sigma_alpha     14.29    0.13  1.84   11.12   12.91   14.07   15.38   17.95   207 1.01
sigma_beta       0.52    0.01  0.09    0.37    0.46    0.52    0.58    0.69   191 1.00
alpha0         106.34    0.25  3.52   99.36  104.14  106.51  108.60  112.41   205 0.99
lp__          -438.55    0.82  6.57 -451.07 -442.73 -438.49 -434.54 -425.79    65 1.05

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).


Thin every other sample


Inference for Stan model: rats.
4 chains, each with iter=1500; warmup=1000; thin=1; 
post-warmup draws per chain=500, total post-warmup draws=2000.

                 mean se_mean    sd    2.5%     25%     50%     75%   97.5% n_eff Rhat
alpha[1]       239.97    0.06  2.65  234.70  238.17  239.92  241.82  245.18  1719    1
alpha[2]       247.84    0.06  2.72  242.48  246.01  247.87  249.76  253.01  1797    1
alpha[3]       252.45    0.06  2.57  247.19  250.80  252.46  254.16  257.34  1645    1
alpha[4]       232.61    0.07  2.70  227.33  230.84  232.59  234.34  237.94  1676    1
alpha[5]       231.54    0.07  2.72  226.15  229.78  231.52  233.40  236.68  1739    1
alpha[6]       249.78    0.07  2.66  244.59  248.08  249.76  251.52  255.11  1656    1
alpha[7]       228.80    0.07  2.67  223.74  227.07  228.77  230.46  234.23  1603    1
alpha[8]       248.30    0.06  2.65  243.14  246.51  248.28  250.07  253.59  1742    1
alpha[9]       283.28    0.07  2.69  277.61  281.50  283.40  285.09  288.40  1612    1
alpha[10]      219.27    0.07  2.61  214.07  217.55  219.25  221.08  224.21  1568    1
alpha[11]      258.32    0.06  2.74  252.86  256.57  258.29  260.15  263.94  1808    1
alpha[12]      228.13    0.06  2.72  222.74  226.29  228.13  229.97  233.58  1766    1
alpha[13]      242.43    0.07  2.72  237.10  240.68  242.49  244.21  247.82  1634    1
alpha[14]      268.35    0.07  2.73  263.01  266.49  268.36  270.20  273.71  1726    1
alpha[15]      242.80    0.07  2.73  237.54  241.00  242.83  244.64  248.04  1526    1
alpha[16]      245.35    0.06  2.65  240.18  243.60  245.34  247.07  250.65  1831    1
alpha[17]      232.15    0.07  2.68  227.06  230.39  232.14  233.91  237.45  1592    1
alpha[18]      240.47    0.06  2.68  235.32  238.64  240.47  242.25  245.75  1757    1
alpha[19]      253.79    0.07  2.70  248.34  252.02  253.81  255.58  259.14  1671    1
alpha[20]      241.68    0.06  2.67  236.50  239.86  241.69  243.46  246.92  1698    1
alpha[21]      248.56    0.06  2.69  243.13  246.77  248.62  250.29  253.96  1727    1
alpha[22]      225.32    0.06  2.62  220.20  223.59  225.33  227.11  230.53  1745    1
alpha[23]      228.64    0.06  2.69  223.33  226.90  228.65  230.40  234.00  1774    1
alpha[24]      245.01    0.06  2.61  239.69  243.32  245.03  246.61  250.22  1976    1
alpha[25]      234.52    0.06  2.61  229.52  232.81  234.50  236.25  239.64  1752    1
alpha[26]      253.93    0.06  2.65  248.75  252.16  253.97  255.65  259.26  1782    1
alpha[27]      254.38    0.07  2.68  249.18  252.53  254.31  256.22  259.54  1679    1
alpha[28]      243.06    0.07  2.64  237.90  241.36  243.11  244.75  248.22  1496    1
alpha[29]      217.90    0.07  2.71  212.45  216.08  217.90  219.81  223.25  1577    1
alpha[30]      241.33    0.06  2.63  236.22  239.55  241.33  243.03  246.42  1758    1
beta[1]          6.05    0.01  0.24    5.59    5.89    6.05    6.21    6.50  1812    1
beta[2]          7.04    0.01  0.26    6.55    6.87    7.04    7.22    7.53  1769    1
beta[3]          6.48    0.01  0.24    6.02    6.32    6.48    6.64    6.93  1773    1
beta[4]          5.34    0.01  0.26    4.82    5.17    5.34    5.51    5.85  1851    1
beta[5]          6.57    0.01  0.24    6.12    6.41    6.57    6.72    7.06  1680    1
beta[6]          6.18    0.01  0.24    5.70    6.02    6.18    6.34    6.66  1615    1
beta[7]          5.98    0.01  0.24    5.51    5.82    5.97    6.14    6.45  1654    1
beta[8]          6.41    0.01  0.25    5.92    6.24    6.41    6.57    6.89  1691    1
beta[9]          7.06    0.01  0.26    6.57    6.89    7.06    7.24    7.56  1512    1
beta[10]         5.86    0.01  0.24    5.38    5.70    5.86    6.02    6.33  1748    1
beta[11]         6.80    0.01  0.25    6.30    6.64    6.80    6.97    7.28  1862    1
beta[12]         6.12    0.01  0.25    5.63    5.95    6.12    6.29    6.60  1646    1
beta[13]         6.16    0.01  0.24    5.70    5.99    6.16    6.33    6.61  1826    1
beta[14]         6.69    0.01  0.25    6.19    6.52    6.68    6.86    7.18  1467    1
beta[15]         5.42    0.01  0.24    4.94    5.26    5.43    5.58    5.90  1799    1
beta[16]         5.93    0.01  0.24    5.45    5.77    5.93    6.08    6.40  1722    1
beta[17]         6.27    0.01  0.23    5.83    6.11    6.26    6.42    6.72  1560    1
beta[18]         5.84    0.01  0.25    5.35    5.68    5.84    6.00    6.33  1561    1
beta[19]         6.40    0.01  0.24    5.94    6.24    6.40    6.55    6.89  1817    1
beta[20]         6.05    0.01  0.23    5.59    5.90    6.06    6.21    6.51  1755    1
beta[21]         6.40    0.01  0.25    5.90    6.24    6.41    6.57    6.86  1703    1
beta[22]         5.85    0.01  0.23    5.40    5.70    5.85    6.00    6.30  1796    1
beta[23]         5.74    0.01  0.24    5.26    5.58    5.75    5.90    6.21  1624    1
beta[24]         5.88    0.01  0.24    5.41    5.72    5.88    6.04    6.36  1775    1
beta[25]         6.92    0.01  0.26    6.42    6.74    6.91    7.09    7.41  1597    1
beta[26]         6.54    0.01  0.24    6.08    6.39    6.54    6.71    7.03  1660    1
beta[27]         5.89    0.01  0.24    5.42    5.73    5.89    6.05    6.38  1770    1
beta[28]         5.86    0.01  0.24    5.38    5.70    5.86    6.02    6.32  1720    1
beta[29]         5.67    0.01  0.24    5.19    5.51    5.67    5.83    6.15  1861    1
beta[30]         6.15    0.01  0.25    5.66    5.98    6.15    6.30    6.64  1757    1
mu_alpha       242.39    0.06  2.70  236.99  240.63  242.35  244.22  247.72  1792    1
mu_beta          6.18    0.00  0.11    5.97    6.11    6.19    6.25    6.40  1756    1
sigmasq_y       37.22    0.15  5.77   27.56   33.15   36.72   40.89   49.68  1441    1
sigmasq_alpha  218.90    1.56 64.37  125.99  174.99  206.83  252.31  372.28  1695    1
sigmasq_beta     0.28    0.00  0.10    0.13    0.21    0.26    0.33    0.52  1794    1
sigma_y          6.08    0.01  0.47    5.25    5.76    6.06    6.39    7.05  1458    1
sigma_alpha     14.65    0.05  2.08   11.22   13.23   14.38   15.88   19.29  1701    1
sigma_beta       0.52    0.00  0.09    0.36    0.45    0.51    0.57    0.72  1769    1
alpha0         106.36    0.08  3.54   99.52  103.94  106.29  108.70  113.34  1841    1
lp__          -437.99    0.24  7.13 -453.46 -442.39 -437.49 -432.91 -425.64   905    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).


Thin 50% of the Samples From each Chain


Inference for Stan model: rats.
4 chains, each with iter=1500; warmup=1000; thin=1; 
post-warmup draws per chain=500, total post-warmup draws=2000.

                 mean se_mean    sd    2.5%     25%     50%     75%   97.5% n_eff Rhat
alpha[1]       239.97    0.06  2.65  234.70  238.17  239.92  241.82  245.18  1719    1
alpha[2]       247.84    0.06  2.72  242.48  246.01  247.87  249.76  253.01  1795    1
alpha[3]       252.44    0.06  2.57  247.19  250.80  252.46  254.15  257.34  1649    1
alpha[4]       232.61    0.07  2.69  227.33  230.84  232.59  234.34  237.94  1663    1
alpha[5]       231.54    0.07  2.72  226.15  229.78  231.52  233.40  236.68  1739    1
alpha[6]       249.77    0.07  2.66  244.59  248.08  249.76  251.52  255.11  1649    1
alpha[7]       228.80    0.07  2.67  223.74  227.07  228.77  230.45  234.23  1603    1
alpha[8]       248.30    0.06  2.65  243.14  246.51  248.28  250.07  253.59  1741    1
alpha[9]       283.28    0.07  2.69  277.61  281.51  283.40  285.10  288.40  1594    1
alpha[10]      219.26    0.07  2.61  214.07  217.55  219.25  221.08  224.21  1571    1
alpha[11]      258.33    0.06  2.74  252.86  256.57  258.30  260.15  263.94  1807    1
alpha[12]      228.14    0.06  2.72  222.74  226.30  228.13  229.97  233.60  1756    1
alpha[13]      242.43    0.07  2.72  237.10  240.68  242.49  244.21  247.81  1635    1
alpha[14]      268.35    0.07  2.73  263.01  266.50  268.36  270.20  273.70  1728    1
alpha[15]      242.79    0.07  2.73  237.54  241.00  242.82  244.63  248.04  1524    1
alpha[16]      245.35    0.06  2.64  240.19  243.60  245.34  247.07  250.65  1830    1
alpha[17]      232.16    0.07  2.67  227.08  230.39  232.14  233.91  237.45  1604    1
alpha[18]      240.47    0.06  2.69  235.29  238.64  240.47  242.25  245.75  1756    1
alpha[19]      253.79    0.07  2.70  248.34  252.02  253.81  255.58  259.14  1670    1
alpha[20]      241.68    0.07  2.67  236.50  239.87  241.69  243.46  246.92  1689    1
alpha[21]      248.56    0.06  2.69  243.13  246.77  248.63  250.29  253.96  1727    1
alpha[22]      225.32    0.06  2.62  220.20  223.59  225.33  227.11  230.53  1741    1
alpha[23]      228.64    0.06  2.70  223.33  226.89  228.65  230.40  234.00  1777    1
alpha[24]      245.01    0.06  2.62  239.69  243.31  245.02  246.61  250.22  1975    1
alpha[25]      234.53    0.06  2.61  229.56  232.81  234.50  236.25  239.64  1747    1
alpha[26]      253.92    0.06  2.65  248.75  252.15  253.97  255.64  259.32  1795    1
alpha[27]      254.38    0.07  2.68  249.18  252.54  254.31  256.23  259.54  1675    1
alpha[28]      243.06    0.07  2.64  237.90  241.35  243.11  244.75  248.22  1490    1
alpha[29]      217.90    0.07  2.71  212.45  216.07  217.90  219.81  223.25  1577    1
alpha[30]      241.34    0.06  2.63  236.23  239.55  241.34  243.05  246.42  1780    1
beta[1]          6.05    0.01  0.24    5.59    5.89    6.05    6.21    6.50  1812    1
beta[2]          7.04    0.01  0.26    6.55    6.87    7.04    7.22    7.53  1769    1
beta[3]          6.48    0.01  0.24    6.02    6.32    6.48    6.64    6.93  1770    1
beta[4]          5.34    0.01  0.26    4.82    5.17    5.34    5.51    5.85  1849    1
beta[5]          6.57    0.01  0.24    6.12    6.41    6.57    6.72    7.06  1680    1
beta[6]          6.18    0.01  0.24    5.70    6.02    6.18    6.34    6.66  1619    1
beta[7]          5.98    0.01  0.24    5.51    5.82    5.97    6.14    6.45  1652    1
beta[8]          6.41    0.01  0.25    5.92    6.24    6.41    6.57    6.89  1690    1
beta[9]          7.06    0.01  0.26    6.57    6.89    7.06    7.24    7.56  1509    1
beta[10]         5.86    0.01  0.24    5.38    5.70    5.86    6.02    6.33  1746    1
beta[11]         6.80    0.01  0.25    6.30    6.64    6.80    6.97    7.28  1867    1
beta[12]         6.12    0.01  0.25    5.63    5.95    6.12    6.29    6.60  1655    1
beta[13]         6.16    0.01  0.24    5.70    5.99    6.16    6.33    6.61  1836    1
beta[14]         6.69    0.01  0.25    6.19    6.52    6.68    6.86    7.18  1466    1
beta[15]         5.42    0.01  0.24    4.94    5.26    5.43    5.58    5.90  1797    1
beta[16]         5.93    0.01  0.24    5.45    5.77    5.93    6.08    6.40  1725    1
beta[17]         6.27    0.01  0.23    5.83    6.11    6.26    6.42    6.72  1555    1
beta[18]         5.84    0.01  0.25    5.35    5.68    5.84    6.00    6.33  1579    1
beta[19]         6.40    0.01  0.24    5.94    6.24    6.40    6.55    6.89  1817    1
beta[20]         6.05    0.01  0.23    5.59    5.90    6.06    6.21    6.51  1741    1
beta[21]         6.40    0.01  0.24    5.90    6.24    6.41    6.57    6.86  1677    1
beta[22]         5.85    0.01  0.23    5.40    5.70    5.85    6.00    6.29  1793    1
beta[23]         5.74    0.01  0.24    5.26    5.58    5.75    5.90    6.21  1636    1
beta[24]         5.88    0.01  0.24    5.41    5.72    5.88    6.04    6.36  1772    1
beta[25]         6.92    0.01  0.26    6.43    6.74    6.91    7.09    7.41  1602    1
beta[26]         6.54    0.01  0.24    6.08    6.39    6.54    6.71    7.03  1658    1
beta[27]         5.89    0.01  0.24    5.42    5.73    5.89    6.05    6.37  1750    1
beta[28]         5.86    0.01  0.24    5.38    5.70    5.86    6.02    6.32  1715    1
beta[29]         5.67    0.01  0.24    5.19    5.51    5.67    5.83    6.15  1861    1
beta[30]         6.15    0.01  0.25    5.66    5.98    6.15    6.30    6.64  1756    1
mu_alpha       242.39    0.06  2.70  236.99  240.63  242.35  244.23  247.72  1788    1
mu_beta          6.18    0.00  0.11    5.97    6.11    6.19    6.25    6.40  1752    1
sigmasq_y       37.23    0.15  5.77   27.56   33.15   36.72   40.89   49.68  1441    1
sigmasq_alpha  218.83    1.56 64.27  125.99  174.86  206.57  252.31  372.28  1696    1
sigmasq_beta     0.28    0.00  0.10    0.13    0.20    0.26    0.33    0.52  1795    1
sigma_y          6.08    0.01  0.47    5.25    5.76    6.06    6.39    7.05  1458    1
sigma_alpha     14.65    0.05  2.08   11.22   13.22   14.37   15.88   19.29  1702    1
sigma_beta       0.52    0.00  0.09    0.36    0.45    0.51    0.57    0.72  1771    1
alpha0         106.36    0.08  3.54   99.52  103.94  106.28  108.70  113.34  1837    1
lp__          -437.99    0.24  7.12 -453.46 -442.38 -437.50 -432.91 -425.64   901    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).


Select and Slice

Inference for Stan model: rats.
4 chains, each with iter=1050; warmup=1000; thin=1; 
post-warmup draws per chain=50, total post-warmup draws=200.

           mean se_mean   sd   2.5%   25%    50%    75%  97.5% n_eff Rhat
mu_alpha 242.33    0.16 2.51 236.55 240.8 242.34 244.04 246.96   247    1

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).

Retain Chains

Inference for Stan model: rats.
1 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=1000.

                 mean se_mean    sd    2.5%     25%     50%     75%   97.5% n_eff Rhat
alpha[1]       239.97    0.06  2.55  235.07  238.17  239.98  241.68  244.79  1971    1
alpha[2]       247.83    0.06  2.75  242.15  245.99  247.87  249.58  253.29  1834    1
alpha[3]       252.30    0.06  2.64  246.84  250.71  252.32  254.01  257.59  1780    1
alpha[4]       232.64    0.06  2.69  227.22  230.91  232.66  234.32  237.78  2299    1
alpha[5]       231.66    0.06  2.71  226.39  229.85  231.62  233.48  236.94  2086    1
alpha[6]       249.75    0.07  2.87  244.00  247.95  249.76  251.59  255.45  1835    1
alpha[7]       228.62    0.06  2.77  223.13  226.88  228.59  230.29  234.20  2382    1
alpha[8]       248.33    0.06  2.64  243.19  246.55  248.28  250.11  253.61  1788    1
alpha[9]       283.25    0.07  2.68  277.65  281.58  283.34  284.96  288.30  1418    1
alpha[10]      219.27    0.06  2.64  213.95  217.56  219.27  221.05  224.29  2133    1
alpha[11]      258.26    0.06  2.71  253.19  256.46  258.27  259.99  264.09  2107    1
alpha[12]      228.05    0.06  2.84  222.65  226.08  228.00  230.11  233.85  2353    1
alpha[13]      242.39    0.07  2.68  237.13  240.64  242.39  244.14  247.98  1524    1
alpha[14]      268.26    0.07  2.72  263.00  266.45  268.20  270.04  273.54  1570    1
alpha[15]      242.75    0.07  2.72  237.69  240.84  242.69  244.62  248.12  1671    1
alpha[16]      245.32    0.06  2.64  239.93  243.65  245.37  247.00  250.59  1648    1
alpha[17]      232.22    0.08  2.82  226.88  230.23  232.24  234.12  237.91  1252    1
alpha[18]      240.47    0.07  2.85  234.62  238.68  240.60  242.33  246.24  1612    1
alpha[19]      253.71    0.06  2.54  248.74  252.03  253.74  255.41  258.54  1987    1
alpha[20]      241.69    0.07  2.69  236.50  239.92  241.70  243.39  247.02  1596    1
alpha[21]      248.44    0.07  2.72  243.38  246.64  248.42  250.17  254.00  1734    1
alpha[22]      225.27    0.06  2.62  220.43  223.46  225.22  227.02  230.32  1713    1
alpha[23]      228.53    0.06  2.83  223.11  226.72  228.48  230.40  233.96  2640    1
alpha[24]      245.15    0.05  2.71  239.70  243.37  245.28  246.91  250.34  2580    1
alpha[25]      234.51    0.06  2.64  229.10  232.81  234.44  236.34  239.42  1914    1
alpha[26]      253.97    0.06  2.80  248.72  252.07  254.03  255.90  259.33  2546    1
alpha[27]      254.35    0.06  2.72  248.84  252.43  254.35  256.17  259.49  2040    1
alpha[28]      243.05    0.06  2.70  237.70  241.39  243.16  244.82  248.08  1900    1
alpha[29]      218.04    0.06  2.74  212.09  216.28  218.04  219.70  223.56  1817    1
alpha[30]      241.32    0.06  2.55  236.07  239.65  241.34  243.00  246.24  1900    1
beta[1]          6.06    0.01  0.24    5.56    5.91    6.06    6.22    6.50  1479    1
beta[2]          7.05    0.01  0.26    6.55    6.87    7.04    7.22    7.55  1911    1
beta[3]          6.48    0.01  0.23    6.07    6.32    6.48    6.64    6.93  1594    1
beta[4]          5.34    0.01  0.25    4.84    5.18    5.35    5.50    5.85  1505    1
beta[5]          6.57    0.01  0.26    6.08    6.39    6.57    6.74    7.08  1694    1
beta[6]          6.17    0.01  0.25    5.71    6.00    6.17    6.32    6.67  1476    1
beta[7]          5.97    0.01  0.23    5.52    5.81    5.97    6.13    6.43  1795    1
beta[8]          6.42    0.01  0.26    5.89    6.25    6.42    6.59    6.94  1842    1
beta[9]          7.05    0.01  0.27    6.53    6.87    7.05    7.23    7.56  1586    1
beta[10]         5.85    0.01  0.26    5.36    5.68    5.85    6.03    6.37  1565    1
beta[11]         6.80    0.01  0.25    6.32    6.62    6.79    6.96    7.29  1498    1
beta[12]         6.12    0.01  0.26    5.57    5.96    6.13    6.30    6.67  1788    1
beta[13]         6.16    0.01  0.23    5.72    6.00    6.16    6.33    6.56  1680    1
beta[14]         6.69    0.01  0.25    6.17    6.53    6.68    6.85    7.19  1554    1
beta[15]         5.42    0.01  0.24    4.95    5.26    5.43    5.59    5.89  1420    1
beta[16]         5.93    0.01  0.24    5.46    5.77    5.93    6.09    6.41  1852    1
beta[17]         6.27    0.01  0.24    5.83    6.11    6.26    6.43    6.75  1566    1
beta[18]         5.85    0.01  0.25    5.36    5.68    5.84    6.01    6.34  1971    1
beta[19]         6.40    0.01  0.24    5.91    6.24    6.40    6.56    6.86  1738    1
beta[20]         6.05    0.01  0.25    5.56    5.89    6.04    6.21    6.54  1961    1
beta[21]         6.40    0.01  0.24    5.93    6.23    6.40    6.56    6.88  1868    1
beta[22]         5.86    0.01  0.23    5.41    5.70    5.86    6.00    6.29  1826    1
beta[23]         5.75    0.01  0.24    5.28    5.58    5.76    5.91    6.22  1636    1
beta[24]         5.90    0.01  0.25    5.42    5.73    5.89    6.07    6.39  1576    1
beta[25]         6.90    0.01  0.27    6.36    6.72    6.90    7.08    7.43  1316    1
beta[26]         6.55    0.01  0.24    6.09    6.39    6.54    6.71    7.00  1163    1
beta[27]         5.89    0.01  0.24    5.43    5.72    5.88    6.05    6.35  2085    1
beta[28]         5.85    0.01  0.25    5.36    5.68    5.86    6.02    6.33  1728    1
beta[29]         5.67    0.01  0.24    5.20    5.51    5.67    5.84    6.12  2001    1
beta[30]         6.13    0.01  0.24    5.68    5.98    6.13    6.28    6.62  1892    1
mu_alpha       242.43    0.07  2.56  237.52  240.65  242.34  244.12  247.45  1528    1
mu_beta          6.18    0.00  0.11    5.97    6.11    6.19    6.25    6.39  1663    1
sigmasq_y       37.56    0.25  5.95   27.72   33.28   36.99   41.00   51.85   552    1
sigmasq_alpha  215.99    2.05 61.61  125.43  173.26  205.89  247.32  362.54   900    1
sigmasq_beta     0.27    0.00  0.10    0.12    0.21    0.26    0.33    0.50   860    1
sigma_y          6.11    0.02  0.48    5.26    5.77    6.08    6.40    7.20   581    1
sigma_alpha     14.56    0.06  2.01   11.20   13.16   14.35   15.73   19.04   978    1
sigma_beta       0.52    0.00  0.09    0.35    0.45    0.51    0.57    0.71   851    1
alpha0         106.41    0.08  3.43   99.94  104.14  106.37  108.70  113.00  1782    1
lp__          -438.59    0.50  7.37 -454.88 -443.29 -438.02 -433.58 -425.63   220    1

Samples were drawn using NUTS(diag_e) at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).
rats%>%
   stan_retain(chains = c(1,3))
Inference for Stan model: rats.
2 chains, each with iter=2000; warmup=1000; thin=1; 
post-warmup draws per chain=1000, total post-warmup draws=2000.

                 mean se_mean    sd    2.5%     25%     50%     75%   97.5% n_eff Rhat
alpha[1]       239.92    0.05  2.64  234.85  238.08  239.88  241.66  245.09  3098    1
alpha[2]       247.83    0.05  2.77  242.20  246.01  247.94  249.63  253.21  2562    1
alpha[3]       252.41    0.06  2.63  247.15  250.69  252.38  254.15  257.62  2123    1
alpha[4]       232.64    0.05  2.71  227.29  230.84  232.66  234.40  237.78  3511    1
alpha[5]       231.70    0.05  2.67  226.50  229.87  231.68  233.57  236.80  3138    1
alpha[6]       249.72    0.06  2.72  244.24  247.99  249.69  251.50  255.20  2171    1
alpha[7]       228.66    0.04  2.71  223.16  226.93  228.62  230.38  233.92  3660    1
alpha[8]       248.30    0.05  2.70  243.23  246.47  248.20  250.16  253.61  2915    1
alpha[9]       283.23    0.06  2.71  277.65  281.50  283.27  284.98  288.40  2120    1
alpha[10]      219.28    0.04  2.55  214.27  217.59  219.23  221.01  224.10  3376    1
alpha[11]      258.27    0.05  2.64  253.15  256.54  258.27  260.00  263.81  3434    1
alpha[12]      228.10    0.05  2.72  222.94  226.21  228.07  229.96  233.53  3593    1
alpha[13]      242.40    0.05  2.74  237.11  240.55  242.40  244.20  247.99  2544    1
alpha[14]      268.25    0.05  2.79  262.70  266.32  268.23  270.15  273.65  2815    1
alpha[15]      242.78    0.05  2.68  237.58  241.00  242.83  244.61  247.96  2694    1
alpha[16]      245.31    0.05  2.63  240.05  243.63  245.29  247.01  250.57  2989    1
alpha[17]      232.24    0.05  2.72  227.13  230.36  232.24  234.09  237.49  2551    1
alpha[18]      240.48    0.05  2.74  235.18  238.69  240.47  242.28  245.83  3121    1
alpha[19]      253.75    0.05  2.54  248.87  252.03  253.77  255.50  258.63  2606    1
alpha[20]      241.68    0.05  2.71  236.39  239.83  241.67  243.47  246.90  3085    1
alpha[21]      248.49    0.05  2.66  243.11  246.71  248.56  250.21  253.88  2593    1
alpha[22]      225.31    0.05  2.60  220.39  223.57  225.28  227.02  230.33  3145    1
alpha[23]      228.53    0.05  2.74  223.37  226.71  228.51  230.36  233.93  3531    1
alpha[24]      245.14    0.05  2.66  239.73  243.37  245.15  246.87  250.42  2572    1
alpha[25]      234.55    0.05  2.65  229.28  232.81  234.50  236.32  239.64  3051    1
alpha[26]      253.98    0.05  2.71  248.72  252.19  254.04  255.84  259.26  3235    1
alpha[27]      254.33    0.05  2.65  249.12  252.40  254.32  256.14  259.42  3477    1
alpha[28]      243.00    0.05  2.59  237.95  241.36  243.07  244.68  248.10  2461    1
alpha[29]      217.97    0.05  2.70  212.41  216.17  217.97  219.74  223.31  2734    1
alpha[30]      241.31    0.05  2.64  236.10  239.57  241.36  243.10  246.26  3254    1
beta[1]          6.06    0.00  0.23    5.59    5.90    6.05    6.22    6.50  2997    1
beta[2]          7.05    0.00  0.25    6.56    6.88    7.04    7.22    7.54  2760    1
beta[3]          6.48    0.00  0.24    6.02    6.32    6.48    6.64    6.94  2519    1
beta[4]          5.34    0.01  0.26    4.83    5.18    5.35    5.51    5.86  2328    1
beta[5]          6.56    0.00  0.24    6.10    6.40    6.56    6.72    7.05  2790    1
beta[6]          6.18    0.00  0.24    5.69    6.01    6.18    6.33    6.66  2677    1
beta[7]          5.97    0.00  0.24    5.51    5.81    5.97    6.14    6.45  2693    1
beta[8]          6.42    0.01  0.26    5.90    6.25    6.42    6.59    6.94  2514    1
beta[9]          7.06    0.01  0.26    6.56    6.88    7.06    7.23    7.56  2290    1
beta[10]         5.86    0.00  0.25    5.38    5.69    5.85    6.02    6.34  2581    1
beta[11]         6.79    0.00  0.25    6.30    6.62    6.79    6.96    7.29  2781    1
beta[12]         6.12    0.00  0.25    5.63    5.96    6.12    6.30    6.61  2631    1
beta[13]         6.16    0.00  0.25    5.68    5.99    6.16    6.33    6.62  3157    1
beta[14]         6.69    0.00  0.24    6.21    6.53    6.69    6.85    7.15  2843    1
beta[15]         5.42    0.00  0.25    4.94    5.25    5.42    5.58    5.89  2751    1
beta[16]         5.93    0.00  0.24    5.46    5.76    5.92    6.08    6.41  3068    1
beta[17]         6.27    0.01  0.23    5.83    6.11    6.26    6.43    6.73  2008    1
beta[18]         5.84    0.00  0.25    5.34    5.67    5.84    6.00    6.33  2601    1
beta[19]         6.40    0.00  0.24    5.94    6.24    6.40    6.56    6.86  2623    1
beta[20]         6.05    0.00  0.24    5.58    5.89    6.04    6.21    6.52  3536    1
beta[21]         6.40    0.00  0.25    5.94    6.23    6.40    6.57    6.89  3160    1
beta[22]         5.86    0.00  0.23    5.41    5.70    5.86    6.01    6.31  3102    1
beta[23]         5.75    0.00  0.24    5.28    5.58    5.75    5.90    6.21  2737    1
beta[24]         5.89    0.00  0.25    5.39    5.72    5.89    6.06    6.37  2759    1
beta[25]         6.90    0.01  0.26    6.38    6.73    6.90    7.08    7.44  2107    1
beta[26]         6.55    0.00  0.23    6.09    6.40    6.55    6.71    7.01  2302    1
beta[27]         5.89    0.00  0.24    5.42    5.72    5.88    6.05    6.36  2993    1
beta[28]         5.85    0.00  0.25    5.35    5.68    5.86    6.01    6.33  2548    1
beta[29]         5.67    0.00  0.25    5.18    5.50    5.67    5.84    6.15  3431    1
beta[30]         6.13    0.00  0.24    5.66    5.97    6.13    6.28    6.62  3065    1
mu_alpha       242.46    0.05  2.56  237.23  240.72  242.49  244.15  247.62  2442    1
mu_beta          6.18    0.00  0.11    5.97    6.11    6.18    6.25    6.40  2200    1
sigmasq_y       37.32    0.17  5.69   27.80   33.29   36.82   40.79   50.17  1097    1
sigmasq_alpha  216.72    1.61 64.15  123.29  172.55  205.03  249.62  372.27  1584    1
sigmasq_beta     0.28    0.00  0.10    0.13    0.21    0.26    0.33    0.51  1546    1
sigma_y          6.09    0.01  0.46    5.27    5.77    6.07    6.39    7.08  1134    1
sigma_alpha     14.57    0.05  2.07   11.10   13.14   14.32   15.80   19.29  1724    1
sigma_beta       0.52    0.00  0.09    0.35    0.45    0.51    0.58    0.72  1513    1
alpha0         106.45    0.07  3.48   99.59  104.12  106.44  108.77  113.26  2426    1
lp__          -438.21    0.31  7.10 -453.84 -442.73 -437.79 -433.41 -425.47   537    1

Samples were drawn using NUTS(diag_e) at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).

Filter

Users can filter conditionally on posterior samples. The function will locate the indicies that the logical expression returns for each chain. Due to a constraint in rstan::extract with permuted=FALSE chains are assumed to be of equal size. To keep this assumption the chain size returned is the length of the shortest conditional chain. If there is a chain that results in no samples then the chain is dropped with a warning. If no elements are returned for any chain then NULL is returned.

rats%>%
   stan_select(mu_alpha,mu_beta)%>%
   stan_filter(mu_beta < 6)
Inference for Stan model: rats.
4 chains, each with iter=1032; warmup=1000; thin=1; 
post-warmup draws per chain=32, total post-warmup draws=128.

           mean se_mean   sd   2.5%    25%    50%    75%  97.5% n_eff Rhat
mu_alpha 242.40    0.23 2.60 236.46 241.01 242.67 244.08 246.88   127 1.02
mu_beta    5.95    0.01 0.05   5.83   5.94   5.97   5.98   6.00    86 1.04

Samples were drawn using  at Fri Feb  7 10:23:47 2020.
For each parameter, n_eff is a crude measure of effective sample size,
and Rhat is the potential scale reduction factor on split chains (at 
convergence, Rhat=1).