Once we have fit a model that we are satisfied with, and have performed basic checks for MCMC posterior convergence, we can proceed with inference tasks. Using our posterior samples from Stan or JAGS, and assuming we were satisfied with our model, let’s calculate:
- A 95% CI for the difference in expenditure for Males vs. Females (of referent ethnicity and age cohort, if you included interactions)
- Probability that a person who identifies as Multi Race receives less expenditure than a person who is Hispanic
- The probability that the standard error of the residuals (sigma) is greater than 4000.
## [1] 7
## Inference for Stan model: 93c7df36ddbda0cebec5440a0d588862.
## 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%
## beta[1] 204.44 65.87 1918.93 -3536.86 -1089.45 222.17 1499.11 3995.12
## beta[2] 52277.24 13.71 574.93 51172.30 51890.92 52273.76 52661.89 53412.46
## beta[3] 760.30 13.34 508.28 -247.83 418.45 752.54 1105.71 1776.87
## beta[4] 2533.83 12.71 507.93 1531.75 2192.43 2538.56 2862.19 3528.03
## beta[5] 8546.30 12.47 506.81 7575.76 8199.76 8547.02 8893.16 9549.65
## beta[6] 38982.23 13.12 508.79 37980.72 38641.13 38986.24 39319.11 39991.48
## beta[7] -953.13 4.16 249.50 -1440.55 -1122.87 -955.30 -785.54 -477.56
## beta[8] 1442.47 65.25 1904.00 -2403.06 165.51 1446.47 2750.71 5212.78
## beta[9] 1824.81 65.75 1941.29 -1979.38 525.75 1816.95 3130.25 5653.17
## beta[10] 1859.60 64.52 1877.61 -1875.81 610.87 1825.89 3139.55 5542.52
## beta[11] 1619.36 66.27 2052.90 -2401.84 262.00 1622.77 3000.93 5617.17
## beta[12] -531.25 71.23 2861.61 -6316.08 -2452.85 -466.35 1436.04 4925.53
## beta[13] 1056.29 76.42 3315.15 -5391.77 -1209.35 1024.02 3364.17 7472.77
## beta[14] 1445.28 64.16 1870.37 -2278.21 190.35 1436.81 2707.75 5101.64
## sigma 3883.73 1.56 87.06 3718.07 3823.89 3882.64 3942.01 4060.67
## lp__ -8755.65 0.06 2.69 -8761.88 -8757.24 -8755.35 -8753.71 -8751.40
## n_eff Rhat
## beta[1] 849 1.01
## beta[2] 1759 1.00
## beta[3] 1451 1.00
## beta[4] 1597 1.00
## beta[5] 1652 1.00
## beta[6] 1505 1.00
## beta[7] 3599 1.00
## beta[8] 851 1.01
## beta[9] 872 1.01
## beta[10] 847 1.01
## beta[11] 960 1.00
## beta[12] 1614 1.00
## beta[13] 1882 1.00
## beta[14] 850 1.01
## sigma 3120 1.00
## lp__ 1723 1.00
##
## Samples were drawn using NUTS(diag_e) at Tue Aug 25 17:26:17 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).
## [1] 0.6125
## [1] 0.52629
## [1] 0.5241373
## [1] 0.0955