library(foreign)
## Warning: package 'foreign' was built under R version 3.2.5
r=read.dta("C:/Users/BINH THANG/Dropbox/Korea/STudy/Thesis/data management/DataR/dataR5a.dta")

r1 <- subset(r, cost_inc>1 )

attach(r1)

r1$logC1=log10(r1$cost_inc)

r1$logC2=r1$cost_inc/1000

r1$highper[cost_inc<=62000] <- 0
r1$highper[cost_inc>62000] <- 1


r1$b16a[b16a == 5] <- 0


r1$freeEn[c9==1] <- 1
r1$freeEn[c9>1] <- 0




r1$h1[h1== 1] <- 1
r1$h1[h1== 2] <- 0


r1$c7ad[c7== 2] <- 0
r1$c7ad[c7== 1] <- 1
r1$c7ad[is.na(r1$c7)] <- 0


r1$ant[c5==1& c5==2 & c5==7 & c5==8 & c5==9] <- 0
r1$ant[c5==3|c5==4|c5==5] <- 1
r1$ant[is.na(r1$c5)] <- 0


r1$p1=r1$label1+r1$freeEn+r1$ant+r1$c7ad

r1$p[r1$p1==0] <- 0
r1$p[r1$p1==1] <- 1
r1$p[r1$p1>=2] <- 2

r1$wtp[cost_inc >=1] <- 0
r1$wtp[is.na(r1$wtp)] <- 1






newdata2=r1

attach(newdata2 )
## The following objects are masked from r1:
## 
##     a, a1, advice, ag, age_group, anticam, b1, b10, b10a1, b10a2,
##     b10a3, b10a4, b10a5, b10a6, b10a7, b11, b11a, b11a2, b11a3,
##     b12, b12a, b13, b14, b15, b16, b16a, b17, b18, b18a, b1a,
##     b1a1, b1a2, b1a3, b2, b2a1, b3, b4, b5, b5a, b6, b6_123, b6a,
##     b6a1, b6a2, b6a3, b6a4, b6a5, b6a6, b6a7, b6a7a, b6b, b7, b8,
##     b9, br, branch, branch1, branch2, branch3, c1, c2, c23a, c3,
##     c4, c5, c6, c6a111, c7, c8, c9, clog, clog1, COST, cost_inc,
##     cost1, costincrease, ct, d1, d10, d11, d1a, d2, d3, d3a, d4,
##     d5, d6, d7, d8, d9, Decision, e1, e2, edu, educ1, educ2, f1,
##     ghi1, ghi2, ghiro2, giadinhkoUH, group_age, group_age1, h1,
##     h10a, h10a1, h10a10, h10a11, h10a11a, h10a2, h10a3, h10a4,
##     h10a5, h10a6, h10a7, h10a8, h10a9, h12, h12a, h12a_1, h12log,
##     h13, h2, h3, h4, h5, h6, h7, h8, h9, ha000, ict1a, ict2a,
##     itc1, itc2, l1, l2, l3, l4, l5, l6, label_1, label1, label1a,
##     logb7, logC, logitCost, moneyspent, msdt, n01, n02, n03, n05,
##     n06, n07, n08, n1, n10, n100, n101, n102, n103, n11, n12, n13,
##     n14, n15, n16, n1b, n2, n3, n35, n36, n37, n38, n39,
##     n3posterb, n4, n40, n41, n42, n43, n44, n45, n46, n47, n48,
##     n49, n5, n50, n51, n52, n53, n54, n55, n56, n57, n58, n59, n6,
##     n60, n61, n61a, n62, n62a, n63, n63a, n64, n64a, n65, n65a,
##     n66, n66a, n67, n67a, n68, n68a, n7, n77, n78, n7tren, n8,
##     n88, n89, n8nha, n9, n97, n98, n99, n9khach, noE, noEnvi2,
##     occup1, poli4, poli4a, policy, policy_a, policyeffect,
##     reasons, reasons1, s1, Screening, selfhealth, SH1, smostt,
##     taxIn, ter_fa1, ter_in, tertile_fa, tertile_indi, test,
##     unitsdiffi1, var242, w1, w2, w3, w4

0.1 define varibles

newdata2$age_group1[newdata2$age_group=="group18-29"] <- 1
newdata2$age_group1[newdata2$age_group=="gr3039"] <- 2
newdata2$age_group1[newdata2$age_group=="gr4049"] <- 3
newdata2$age_group1[newdata2$age_group=="gr5059"] <- 4
newdata2$age_group1[newdata2$age_group=="60plus"] <- 4

newdata2$age_group1=as.factor(newdata2$age_group1)


newdata2$educ2=as.factor(newdata2$educ2)

newdata2$h1=as.factor(newdata2$h1)

newdata2$d1a=as.factor(newdata2$d1a)

newdata2$b6b=as.factor(newdata2$b6b)
newdata2$selfhealth=as.factor(newdata2$selfhealth)

newdata2$b18a=as.factor(newdata2$b18a)

newdata2$b16a=as.factor(newdata2$b16a)



newdata2$smostt=as.factor(newdata2$smostt)

newdata2$ter_in=as.factor(newdata2$ter_in)

newdata2$group_age1=as.factor(newdata2$group_age1)

newdata2$label1=as.factor(newdata2$label1)
newdata2$freeEn=as.factor(newdata2$freeEn)
newdata2$c7ad=as.factor(newdata2$c7ad)
newdata2$ant=as.factor(newdata2$ant)

newdata2$p=as.factor(newdata2$p)


newdata2$in00[newdata2$ter_in==1] <- 1
newdata2$in00[newdata2$ter_in==2 | ter_in==3] <- 0

newdata2$in00=as.factor(newdata2$in00)

attach(newdata2)
## The following objects are masked from newdata2 (pos = 3):
## 
##     a, a1, advice, ag, age_group, ant, anticam, b1, b10, b10a1,
##     b10a2, b10a3, b10a4, b10a5, b10a6, b10a7, b11, b11a, b11a2,
##     b11a3, b12, b12a, b13, b14, b15, b16, b16a, b17, b18, b18a,
##     b1a, b1a1, b1a2, b1a3, b2, b2a1, b3, b4, b5, b5a, b6, b6_123,
##     b6a, b6a1, b6a2, b6a3, b6a4, b6a5, b6a6, b6a7, b6a7a, b6b, b7,
##     b8, b9, br, branch, branch1, branch2, branch3, c1, c2, c23a,
##     c3, c4, c5, c6, c6a111, c7, c7ad, c8, c9, clog, clog1, COST,
##     cost_inc, cost1, costincrease, ct, d1, d10, d11, d1a, d2, d3,
##     d3a, d4, d5, d6, d7, d8, d9, Decision, e1, e2, edu, educ1,
##     educ2, f1, freeEn, ghi1, ghi2, ghiro2, giadinhkoUH, group_age,
##     group_age1, h1, h10a, h10a1, h10a10, h10a11, h10a11a, h10a2,
##     h10a3, h10a4, h10a5, h10a6, h10a7, h10a8, h10a9, h12, h12a,
##     h12a_1, h12log, h13, h2, h3, h4, h5, h6, h7, h8, h9, ha000,
##     highper, ict1a, ict2a, itc1, itc2, l1, l2, l3, l4, l5, l6,
##     label_1, label1, label1a, logb7, logC, logC1, logC2,
##     logitCost, moneyspent, msdt, n01, n02, n03, n05, n06, n07,
##     n08, n1, n10, n100, n101, n102, n103, n11, n12, n13, n14, n15,
##     n16, n1b, n2, n3, n35, n36, n37, n38, n39, n3posterb, n4, n40,
##     n41, n42, n43, n44, n45, n46, n47, n48, n49, n5, n50, n51,
##     n52, n53, n54, n55, n56, n57, n58, n59, n6, n60, n61, n61a,
##     n62, n62a, n63, n63a, n64, n64a, n65, n65a, n66, n66a, n67,
##     n67a, n68, n68a, n7, n77, n78, n7tren, n8, n88, n89, n8nha,
##     n9, n97, n98, n99, n9khach, noE, noEnvi2, occup1, p, p1,
##     poli4, poli4a, policy, policy_a, policyeffect, reasons,
##     reasons1, s1, Screening, selfhealth, SH1, smostt, taxIn,
##     ter_fa1, ter_in, tertile_fa, tertile_indi, test, unitsdiffi1,
##     var242, w1, w2, w3, w4, wtp
## The following objects are masked from r1:
## 
##     a, a1, advice, ag, age_group, anticam, b1, b10, b10a1, b10a2,
##     b10a3, b10a4, b10a5, b10a6, b10a7, b11, b11a, b11a2, b11a3,
##     b12, b12a, b13, b14, b15, b16, b16a, b17, b18, b18a, b1a,
##     b1a1, b1a2, b1a3, b2, b2a1, b3, b4, b5, b5a, b6, b6_123, b6a,
##     b6a1, b6a2, b6a3, b6a4, b6a5, b6a6, b6a7, b6a7a, b6b, b7, b8,
##     b9, br, branch, branch1, branch2, branch3, c1, c2, c23a, c3,
##     c4, c5, c6, c6a111, c7, c8, c9, clog, clog1, COST, cost_inc,
##     cost1, costincrease, ct, d1, d10, d11, d1a, d2, d3, d3a, d4,
##     d5, d6, d7, d8, d9, Decision, e1, e2, edu, educ1, educ2, f1,
##     ghi1, ghi2, ghiro2, giadinhkoUH, group_age, group_age1, h1,
##     h10a, h10a1, h10a10, h10a11, h10a11a, h10a2, h10a3, h10a4,
##     h10a5, h10a6, h10a7, h10a8, h10a9, h12, h12a, h12a_1, h12log,
##     h13, h2, h3, h4, h5, h6, h7, h8, h9, ha000, ict1a, ict2a,
##     itc1, itc2, l1, l2, l3, l4, l5, l6, label_1, label1, label1a,
##     logb7, logC, logitCost, moneyspent, msdt, n01, n02, n03, n05,
##     n06, n07, n08, n1, n10, n100, n101, n102, n103, n11, n12, n13,
##     n14, n15, n16, n1b, n2, n3, n35, n36, n37, n38, n39,
##     n3posterb, n4, n40, n41, n42, n43, n44, n45, n46, n47, n48,
##     n49, n5, n50, n51, n52, n53, n54, n55, n56, n57, n58, n59, n6,
##     n60, n61, n61a, n62, n62a, n63, n63a, n64, n64a, n65, n65a,
##     n66, n66a, n67, n67a, n68, n68a, n7, n77, n78, n7tren, n8,
##     n88, n89, n8nha, n9, n97, n98, n99, n9khach, noE, noEnvi2,
##     occup1, poli4, poli4a, policy, policy_a, policyeffect,
##     reasons, reasons1, s1, Screening, selfhealth, SH1, smostt,
##     taxIn, ter_fa1, ter_in, tertile_fa, tertile_indi, test,
##     unitsdiffi1, var242, w1, w2, w3, w4

1 new dataset will work for futher analyst

data=subset(newdata2, select=c(age_group1, d1a,in00, educ2, selfhealth, c1, smostt, b6b, h1, b18a,b6a,label1,freeEn,ant, c7ad, p, logC1, highper))

attach(data)
## The following objects are masked from newdata2 (pos = 3):
## 
##     age_group1, ant, b18a, b6a, b6b, c1, c7ad, d1a, educ2, freeEn,
##     h1, highper, in00, label1, logC1, p, selfhealth, smostt
## The following objects are masked from newdata2 (pos = 4):
## 
##     ant, b18a, b6a, b6b, c1, c7ad, d1a, educ2, freeEn, h1,
##     highper, label1, logC1, p, selfhealth, smostt
## The following objects are masked from r1:
## 
##     b18a, b6a, b6b, c1, d1a, educ2, h1, label1, selfhealth, smostt

2 Tabe 1

require(moonBook)
## Loading required package: moonBook
## Warning: package 'moonBook' was built under R version 3.2.5
mytable(in00~.,data=data)
## 
##      Descriptive Statistics by 'in00'    
## __________________________________________ 
##                   0           1        p  
##                (N=262)     (N=191)  
## ------------------------------------------ 
##  age_group1                          0.000
##    - 1       96 (36.6%)  90 (47.1%)       
##    - 2       60 (22.9%)  16 ( 8.4%)       
##    - 3       68 (26.0%)  26 (13.6%)       
##    - 4       38 (14.5%)  59 (30.9%)       
##  d1a                                 0.000
##    - none    79 (30.2%)  97 (50.8%)       
##    - married 183 (69.8%) 94 (49.2%)       
##  educ2                               0.035
##    - 1       44 (17.2%)  51 (27.0%)       
##    - 2       134 (52.3%) 82 (43.4%)       
##    - 3       78 (30.5%)  56 (29.6%)       
##  selfhealth                          0.631
##    - notwell 141 (53.8%) 108 (56.5%)      
##    - good    121 (46.2%) 83 (43.5%)       
##  c1                                  0.030
##    - 1       235 (89.7%) 157 (82.2%)      
##    - 2       27 (10.3%)  34 (17.8%)       
##  smostt                              0.151
##    - light   63 (24.0%)  59 (30.9%)       
##    - medium  98 (37.4%)  73 (38.2%)       
##    - heavy   101 (38.5%) 59 (30.9%)       
##  b6b                                 0.071
##    - 0       178 (69.5%) 115 (60.8%)      
##    - 1       78 (30.5%)  74 (39.2%)       
##  h1                                  1.000
##    - 0       97 (37.0%)  70 (36.6%)       
##    - 1       165 (63.0%) 121 (63.4%)      
##  b18a                                0.843
##    - Good    86 (33.2%)  66 (34.6%)       
##    - bad     173 (66.8%) 125 (65.4%)      
##  b6a                                 0.050
##    - no      221 (86.3%) 149 (78.8%)      
##    - yes     35 (13.7%)  40 (21.2%)       
##  label1                              0.264
##    - 0       222 (85.1%) 154 (80.6%)      
##    - 1       39 (14.9%)  37 (19.4%)       
##  freeEn                              0.839
##    - 0       198 (76.2%) 143 (74.9%)      
##    - 1       62 (23.8%)  48 (25.1%)       
##  ant                                 0.433
##    - 0       144 (55.0%) 97 (50.8%)       
##    - 1       118 (45.0%) 94 (49.2%)       
##  c7ad                                0.015
##    - 0       185 (70.6%) 113 (59.2%)      
##    - 1       77 (29.4%)  78 (40.8%)       
##  p                                   0.390
##    - 0       82 (31.5%)  51 (26.7%)       
##    - 1       83 (31.9%)  59 (30.9%)       
##    - 2       95 (36.5%)  81 (42.4%)       
##  logC1        4.8 ±  0.3  4.8 ±  0.2 0.116
##  highper                             0.389
##    - 0       128 (48.9%) 102 (53.4%)      
##    - 1       134 (51.1%) 89 (46.6%)       
## ------------------------------------------

2.1 Install packages and library

library("brms")
## Warning: package 'brms' was built under R version 3.2.5
## Loading required package: Rcpp
## Warning: package 'Rcpp' was built under R version 3.2.5
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.2.5
## Loading 'brms' package (version 1.5.1). Useful instructions 
## can be found by typing help('brms'). A more detailed introduction 
## to the package is available through vignette('brms_overview').
library("caret")
## Warning: package 'caret' was built under R version 3.2.5
## Loading required package: lattice
## 
## Attaching package: 'lattice'
## The following object is masked from 'package:moonBook':
## 
##     densityplot
library("coda")
## Warning: package 'coda' was built under R version 3.2.5
library("rstan", lib.loc="~/R/win-library/3.2")
## Warning: package 'rstan' was built under R version 3.2.5
## Loading required package: StanHeaders
## Warning: package 'StanHeaders' was built under R version 3.2.5
## rstan (Version 2.14.1, packaged: 2016-12-28 14:55:41 UTC, GitRev: 5fa1e80eb817)
## For execution on a local, multicore CPU with excess RAM we recommend calling
## rstan_options(auto_write = TRUE)
## options(mc.cores = parallel::detectCores())
## 
## Attaching package: 'rstan'
## The following object is masked from 'package:coda':
## 
##     traceplot

2.2 Model 1.1: model for cost-single policy

data1=subset(data, in00==0)

fit1 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b+label1+freeEn+ant+c7ad, quantile = 0.25), data = data1, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.597 seconds (Warm-up)
##                2.938 seconds (Sampling)
##                5.535 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.546 seconds (Warm-up)
##                2.002 seconds (Sampling)
##                4.548 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.543 seconds (Warm-up)
##                2.567 seconds (Sampling)
##                5.11 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.568 seconds (Warm-up)
##                2.505 seconds (Sampling)
##                5.073 seconds (Total)
summary(fit1)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b + label1 + freeEn + ant + c7ad 
##          quantile = 0.25
##    Data: data1 (Number of observations: 248) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.48      0.06     4.37     4.58       2592    1
## age_group12        0.06      0.03     0.00     0.13       2290    1
## age_group13        0.03      0.04    -0.05     0.12       1572    1
## age_group14       -0.05      0.05    -0.15     0.05       1644    1
## educ22             0.05      0.04    -0.03     0.13       1744    1
## educ23             0.13      0.04     0.04     0.21       1591    1
## d1amarried        -0.01      0.04    -0.08     0.06       1716    1
## h11                0.01      0.03    -0.04     0.07       2594    1
## selfhealthgood     0.09      0.03     0.04     0.14       2562    1
## smosttmedium       0.04      0.04    -0.03     0.11       1933    1
## smosttheavy        0.04      0.04    -0.03     0.12       1823    1
## b18abad            0.07      0.03     0.01     0.13       2351    1
## b6b1              -0.02      0.03    -0.08     0.04       2573    1
## label11           -0.07      0.04    -0.14     0.00       2866    1
## freeEn1           -0.04      0.03    -0.11     0.02       2767    1
## ant1               0.02      0.03    -0.03     0.08       2499    1
## c7ad1              0.03      0.03    -0.02     0.08       3149    1
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     0.07         0     0.06     0.08       2988    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
marginal_effects(fit1)

#evidence ratio


hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (age_group12) > 0     0.06      0.03     0.01      Inf         31 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0     0.03      0.04    -0.03      Inf       3.99 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0    -0.05      0.05    -0.13      Inf       0.21 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0    -0.01      0.04    -0.07      Inf       0.69 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (h11) > 0     0.01      0.03    -0.04      Inf       1.91 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0     0.05      0.04    -0.01      Inf       8.73 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (educ23) > 0     0.13      0.04     0.05      Inf        499 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (selfhealthgood) > 0     0.09      0.03     0.04      Inf    1332.33 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.04      0.04    -0.02      Inf       5.68 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0     0.04      0.04    -0.02      Inf       6.65 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (b18abad) > 0     0.07      0.03     0.02      Inf     141.86 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.02      0.03    -0.07      Inf       0.34 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"label11>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (label11) > 0    -0.07      0.04    -0.13      Inf       0.02 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"freeEn1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (freeEn1) > 0    -0.04      0.03     -0.1      Inf       0.12 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"ant1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (ant1) > 0     0.02      0.03    -0.02      Inf       4.17 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"c7ad1>0",alpha=0.05)
## Hypothesis Tests for class b:
##             Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (c7ad1) > 0     0.03      0.03    -0.02      Inf       5.94 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)

2.3 Model 1.1: model for cost-single policy -0.5

fit1 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b+label1+freeEn+ant+c7ad, quantile = 0.5), data = data1, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.343 seconds (Warm-up)
##                2.453 seconds (Sampling)
##                4.796 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.999 seconds (Warm-up)
##                2.954 seconds (Sampling)
##                5.953 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.829 seconds (Warm-up)
##                2.359 seconds (Sampling)
##                5.188 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.631 seconds (Warm-up)
##                2.385 seconds (Sampling)
##                5.016 seconds (Total)
summary(fit1)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b + label1 + freeEn + ant + c7ad 
##          quantile = 0.5
##    Data: data1 (Number of observations: 248) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.64      0.08     4.49     4.79       2262    1
## age_group12        0.07      0.05    -0.02     0.16       2000    1
## age_group13        0.01      0.05    -0.09     0.10       1970    1
## age_group14        0.00      0.07    -0.13     0.14       1966    1
## educ22             0.01      0.06    -0.09     0.12       1773    1
## educ23             0.11      0.06    -0.01     0.24       1911    1
## d1amarried         0.01      0.04    -0.07     0.09       2198    1
## h11                0.02      0.03    -0.04     0.09       3133    1
## selfhealthgood     0.08      0.03     0.01     0.15       3028    1
## smosttmedium       0.00      0.04    -0.08     0.08       2545    1
## smosttheavy        0.06      0.04    -0.02     0.15       2232    1
## b18abad            0.06      0.04    -0.01     0.13       3345    1
## b6b1              -0.04      0.04    -0.11     0.04       2767    1
## label11           -0.10      0.04    -0.18    -0.01       2561    1
## freeEn1           -0.05      0.04    -0.13     0.04       2532    1
## ant1               0.02      0.04    -0.05     0.10       2226    1
## c7ad1              0.07      0.04    -0.01     0.15       1985    1
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma      0.1      0.01     0.09     0.11       3512    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
marginal_effects(fit1)

#evidence ratio



hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0     0.07      0.05        0      Inf      18.51 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0     0.01      0.05    -0.07      Inf       1.32 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0        0      0.07     -0.1      Inf       1.01 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0     0.01      0.04    -0.06      Inf       1.49 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (h11) > 0     0.02      0.03    -0.03      Inf       3.17 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0     0.01      0.06    -0.08      Inf       1.48 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (educ23) > 0     0.11      0.06     0.01      Inf      26.78 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (selfhealthgood) > 0     0.08      0.03     0.02      Inf     101.56 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0        0      0.04    -0.07      Inf       0.98 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0     0.06      0.04    -0.01      Inf      11.99 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b18abad) > 0     0.06      0.04        0      Inf      17.26 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.04      0.04     -0.1      Inf       0.18 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"label11>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (label11) > 0     -0.1      0.04    -0.17      Inf       0.01 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"freeEn1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (freeEn1) > 0    -0.05      0.04    -0.12      Inf       0.12 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"ant1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (ant1) > 0     0.02      0.04    -0.04      Inf       2.65 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"c7ad1>0",alpha=0.05)
## Hypothesis Tests for class b:
##             Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (c7ad1) > 0     0.07      0.04        0      Inf       18.8 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)

2.4 Model 1.1: model for cost-single policy -0.75

fit1 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b+label1+freeEn+ant+c7ad, quantile = 0.75), data = data1, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.137 seconds (Warm-up)
##                3.052 seconds (Sampling)
##                6.189 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.214 seconds (Warm-up)
##                2.875 seconds (Sampling)
##                6.089 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3 seconds (Warm-up)
##                3.081 seconds (Sampling)
##                6.081 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.109 seconds (Warm-up)
##                2.703 seconds (Sampling)
##                5.812 seconds (Total)
summary(fit1)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b + label1 + freeEn + ant + c7ad 
##          quantile = 0.75
##    Data: data1 (Number of observations: 248) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.93      0.08     4.77     5.09       2618    1
## age_group12        0.03      0.05    -0.07     0.13       2117    1
## age_group13       -0.01      0.06    -0.12     0.11       2208    1
## age_group14        0.01      0.08    -0.14     0.18       2377    1
## educ22            -0.05      0.06    -0.16     0.07       2003    1
## educ23             0.02      0.06    -0.10     0.13       2166    1
## d1amarried         0.00      0.05    -0.10     0.10       2309    1
## h11                0.03      0.04    -0.04     0.10       3063    1
## selfhealthgood     0.05      0.04    -0.02     0.12       2683    1
## smosttmedium      -0.03      0.05    -0.12     0.07       2217    1
## smosttheavy        0.05      0.05    -0.05     0.15       2473    1
## b18abad            0.04      0.04    -0.04     0.12       2748    1
## b6b1              -0.07      0.04    -0.14     0.01       2807    1
## label11           -0.13      0.06    -0.24    -0.02       2875    1
## freeEn1            0.05      0.04    -0.03     0.13       2914    1
## ant1               0.03      0.04    -0.03     0.11       2747    1
## c7ad1              0.10      0.04     0.03     0.18       2502    1
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     0.08      0.01     0.07     0.09       3548    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
marginal_effects(fit1)

#evidence ratio



hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0     0.03      0.05    -0.06      Inf       2.27 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.01      0.06     -0.1      Inf       0.84 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     0.01      0.08    -0.12      Inf       1.21 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0        0      0.05    -0.08      Inf       1.02 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (h11) > 0     0.03      0.04    -0.03      Inf       4.68 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0    -0.05      0.06    -0.14      Inf       0.27 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ23) > 0     0.02      0.06    -0.08      Inf        1.6 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (selfhealthgood) > 0     0.05      0.04    -0.01      Inf      12.16 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0    -0.03      0.05     -0.1      Inf       0.41 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0     0.05      0.05    -0.03      Inf       5.91 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b18abad) > 0     0.04      0.04    -0.03      Inf       4.33 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.07      0.04    -0.13      Inf       0.04 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"label11>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (label11) > 0    -0.13      0.06    -0.22      Inf       0.01 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"freeEn1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (freeEn1) > 0     0.05      0.04    -0.01      Inf       10.2 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"ant1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (ant1) > 0     0.03      0.04    -0.02      Inf       4.71 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"c7ad1>0",alpha=0.05)
## Hypothesis Tests for class b:
##             Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (c7ad1) > 0      0.1      0.04     0.04      Inf     284.71 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)

WAIC(fit, fit10, fit100)

2.5 Model 1.2: model for cost-policy combination

fit2 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b*p, quantile = 0.25), data = data1, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.411 seconds (Warm-up)
##                3.172 seconds (Sampling)
##                6.583 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.235 seconds (Warm-up)
##                3.158 seconds (Sampling)
##                6.393 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.382 seconds (Warm-up)
##                3.129 seconds (Sampling)
##                6.511 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.433 seconds (Warm-up)
##                3.049 seconds (Sampling)
##                6.482 seconds (Total)
summary(fit2)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b * p 
##          quantile = 0.25
##    Data: data1 (Number of observations: 248) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.49      0.06     4.38     4.60       2849    1
## age_group12        0.05      0.04    -0.02     0.12       2767    1
## age_group13        0.03      0.04    -0.04     0.12       2213    1
## age_group14       -0.06      0.05    -0.16     0.04       2547    1
## educ22             0.05      0.04    -0.02     0.12       2735    1
## educ23             0.13      0.04     0.05     0.21       2813    1
## d1amarried         0.00      0.04    -0.07     0.07       2245    1
## h11                0.01      0.03    -0.05     0.07       3097    1
## selfhealthgood     0.10      0.03     0.05     0.15       3300    1
## smosttmedium       0.02      0.04    -0.05     0.09       2245    1
## smosttheavy        0.04      0.04    -0.04     0.11       2426    1
## b18abad            0.08      0.03     0.03     0.14       3221    1
## b6b1              -0.06      0.06    -0.17     0.05       1869    1
## p1                -0.03      0.04    -0.11     0.04       2198    1
## p2                -0.03      0.04    -0.12     0.05       2064    1
## b6b1:p1            0.02      0.07    -0.13     0.16       2069    1
## b6b1:p2            0.05      0.07    -0.09     0.19       1886    1
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     0.07         0     0.06     0.08       3196    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
marginal_effects(fit2)

#evidence ratio



hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0     0.03      0.05    -0.06      Inf       2.27 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.01      0.06     -0.1      Inf       0.84 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     0.01      0.08    -0.12      Inf       1.21 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0        0      0.04    -0.06      Inf       1.18 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (h11) > 0     0.01      0.03    -0.04      Inf       1.92 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0     0.05      0.04    -0.01      Inf        9.9 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (educ23) > 0     0.13      0.04     0.06      Inf    1332.33 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (selfhealthgood) > 0      0.1      0.03     0.06      Inf        Inf *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.02      0.04    -0.04      Inf       2.51 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0     0.04      0.04    -0.02      Inf       4.99 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (b18abad) > 0     0.08      0.03     0.04      Inf     443.44 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.06      0.06    -0.15      Inf        0.2 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p1) > 0    -0.03      0.04     -0.1      Inf       0.22 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p2) > 0    -0.03      0.04     -0.1      Inf       0.28 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p1) > 0     0.02      0.07     -0.1      Inf       1.37 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p2) > 0     0.05      0.07    -0.07      Inf       2.79 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)

2.6 Model 1.2: model for cost-policy combination p=0.5

fit2 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b*p, quantile = 0.5), data = data1, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.969 seconds (Warm-up)
##                2.985 seconds (Sampling)
##                5.954 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.463 seconds (Warm-up)
##                3.266 seconds (Sampling)
##                6.729 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.213 seconds (Warm-up)
##                3.531 seconds (Sampling)
##                6.744 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.173 seconds (Warm-up)
##                2.531 seconds (Sampling)
##                5.704 seconds (Total)
summary(fit2)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b * p 
##          quantile = 0.5
##    Data: data1 (Number of observations: 248) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.66      0.08     4.51     4.82       2324    1
## age_group12        0.05      0.04    -0.04     0.14       2880    1
## age_group13        0.01      0.05    -0.09     0.10       2443    1
## age_group14       -0.03      0.06    -0.16     0.09       2163    1
## educ22             0.02      0.06    -0.08     0.14       1977    1
## educ23             0.11      0.06    -0.01     0.24       1922    1
## d1amarried         0.00      0.04    -0.08     0.08       2429    1
## h11                0.01      0.04    -0.06     0.08       2793    1
## selfhealthgood     0.07      0.03     0.00     0.14       2763    1
## smosttmedium       0.00      0.04    -0.09     0.08       2576    1
## smosttheavy        0.06      0.04    -0.03     0.14       2684    1
## b18abad            0.05      0.04    -0.02     0.13       2718    1
## b6b1              -0.05      0.07    -0.18     0.08       1927    1
## p1                 0.05      0.06    -0.06     0.15       2140    1
## p2                 0.00      0.05    -0.10     0.09       1965    1
## b6b1:p1           -0.06      0.09    -0.24     0.13       1951    1
## b6b1:p2            0.06      0.09    -0.11     0.25       1833    1
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma      0.1      0.01     0.09     0.11       3552    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
marginal_effects(fit2)

#evidence ratio



hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0     0.03      0.05    -0.06      Inf       2.27 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.01      0.06     -0.1      Inf       0.84 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     0.01      0.08    -0.12      Inf       1.21 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0        0      0.04    -0.07      Inf       1.03 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (h11) > 0     0.01      0.04    -0.05      Inf       1.59 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0     0.02      0.06    -0.06      Inf        1.9 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (educ23) > 0     0.11      0.06        0      Inf      22.12 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (selfhealthgood) > 0     0.07      0.03     0.01      Inf      54.56 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0        0      0.04    -0.07      Inf       0.99 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0     0.06      0.04    -0.02      Inf       8.52 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b18abad) > 0     0.05      0.04    -0.01      Inf      13.08 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.05      0.07    -0.16      Inf       0.34 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p1) > 0     0.05      0.06    -0.05      Inf       4.58 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p2) > 0        0      0.05    -0.08      Inf       0.88 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p1) > 0    -0.06      0.09    -0.21      Inf       0.33 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p2) > 0     0.06      0.09    -0.09      Inf        2.8 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)

2.7 Model 1.2: model for cost-policy combination p=0.75

fit2 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b*p, quantile = 0.75), data = data1, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.836 seconds (Warm-up)
##                3.035 seconds (Sampling)
##                6.871 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.978 seconds (Warm-up)
##                4.046 seconds (Sampling)
##                8.024 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.969 seconds (Warm-up)
##                3.173 seconds (Sampling)
##                7.142 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.812 seconds (Warm-up)
##                3.319 seconds (Sampling)
##                7.131 seconds (Total)
summary(fit2)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b * p 
##          quantile = 0.75
##    Data: data1 (Number of observations: 248) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.90      0.08     4.74     5.06       2181 1.00
## age_group12        0.04      0.05    -0.07     0.15       1724 1.00
## age_group13        0.03      0.06    -0.09     0.13       1412 1.00
## age_group14        0.07      0.08    -0.10     0.22       1676 1.00
## educ22             0.01      0.06    -0.11     0.11       1848 1.00
## educ23             0.04      0.05    -0.07     0.15       2022 1.00
## d1amarried         0.00      0.05    -0.10     0.10       1794 1.00
## h11                0.03      0.04    -0.04     0.10       2231 1.00
## selfhealthgood     0.04      0.04    -0.03     0.11       2434 1.00
## smosttmedium      -0.08      0.05    -0.17     0.01       1963 1.00
## smosttheavy        0.03      0.05    -0.06     0.12       1831 1.00
## b18abad            0.08      0.04    -0.01     0.15       2139 1.00
## b6b1              -0.16      0.06    -0.28    -0.03       1244 1.01
## p1                 0.06      0.05    -0.04     0.17       1800 1.00
## p2                -0.01      0.05    -0.11     0.10       1645 1.00
## b6b1:p1            0.12      0.10    -0.06     0.31       1872 1.00
## b6b1:p2            0.26      0.09     0.08     0.43       1219 1.01
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     0.08      0.01     0.07     0.09       3553    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
#evidence ratio



hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0     0.03      0.05    -0.06      Inf       2.27 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.01      0.06     -0.1      Inf       0.84 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     0.01      0.08    -0.12      Inf       1.21 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0        0      0.05    -0.09      Inf       0.86 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (h11) > 0     0.03      0.04    -0.03      Inf       3.85 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0     0.01      0.06    -0.09      Inf       1.42 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ23) > 0     0.04      0.05    -0.05      Inf       3.96 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (selfhealthgood) > 0     0.04      0.04    -0.02      Inf       7.79 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0    -0.08      0.05    -0.16      Inf       0.05 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0     0.03      0.05    -0.05      Inf       2.53 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (b18abad) > 0     0.08      0.04     0.01      Inf      29.53 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.16      0.06    -0.26      Inf       0.01 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p1) > 0     0.06      0.05    -0.02      Inf       7.35 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p2) > 0    -0.01      0.05    -0.09      Inf       0.81 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p1) > 0     0.12       0.1    -0.03      Inf       8.83 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (b6b1:p2) > 0     0.26      0.09     0.11      Inf     332.33 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)

#Model 2: model for persistence

2.8 Model 2.1: single policy

prior=get_prior(formula=highper~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b+label1+freeEn+ant+c7ad, family="bernoulli", data=data1)
## Warning: Rows containing NAs were excluded from the model
set.seed(1234) 
 
fit3=brm(formula=highper~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b+label1+freeEn+ant+c7ad, family="bernoulli", data=data1, chains=5, iter=2000, warmup=1000, prior=prior)
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 1.031 seconds (Warm-up)
##                0.922 seconds (Sampling)
##                1.953 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 1.598 seconds (Warm-up)
##                1.352 seconds (Sampling)
##                2.95 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.997 seconds (Warm-up)
##                1.011 seconds (Sampling)
##                2.008 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 1.213 seconds (Warm-up)
##                1.263 seconds (Sampling)
##                2.476 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 5).
## 
## Chain 5, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 5, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 5, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 5, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 5, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 5, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 5, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 5, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 5, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 5, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 5, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 5, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 1.137 seconds (Warm-up)
##                1.148 seconds (Sampling)
##                2.285 seconds (Total)
summary(fit3)
##  Family: bernoulli (logit) 
## Formula: highper ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b + label1 + freeEn + ant + c7ad 
##    Data: data1 (Number of observations: 248) 
## Samples: 5 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 5000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept         -1.51      0.63    -2.73    -0.25       5000    1
## age_group12        0.55      0.44    -0.30     1.43       3120    1
## age_group13        0.16      0.46    -0.76     1.07       3159    1
## age_group14        0.00      0.53    -1.04     1.05       3524    1
## educ22            -0.25      0.42    -1.06     0.57       3600    1
## educ23             0.81      0.49    -0.14     1.78       3450    1
## d1amarried        -0.13      0.41    -0.93     0.66       3463    1
## h11                0.35      0.31    -0.27     0.97       5000    1
## selfhealthgood     0.77      0.29     0.19     1.34       5000    1
## smosttmedium       0.42      0.38    -0.32     1.16       4700    1
## smosttheavy        0.69      0.40    -0.08     1.47       4500    1
## b18abad            0.59      0.31    -0.05     1.20       5000    1
## b6b1              -0.19      0.32    -0.82     0.41       5000    1
## label11           -0.60      0.44    -1.45     0.25       5000    1
## freeEn1           -0.15      0.34    -0.82     0.52       5000    1
## ant1               0.15      0.29    -0.42     0.73       5000    1
## c7ad1              0.48      0.32    -0.13     1.13       5000    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0     0.03      0.05    -0.06      Inf       2.27 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.01      0.06     -0.1      Inf       0.84 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     0.01      0.08    -0.12      Inf       1.21 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0    -0.13      0.41    -0.81      Inf       0.59 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (h11) > 0     0.35      0.31    -0.17      Inf       6.86 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0    -0.25      0.42    -0.94      Inf       0.37 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (educ23) > 0     0.81      0.49     0.02      Inf      20.65 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (selfhealthgood) > 0     0.77      0.29     0.29      Inf     216.39 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.42      0.38    -0.22      Inf       6.34 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (smosttheavy) > 0     0.69       0.4     0.03      Inf      23.51 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (b18abad) > 0     0.59      0.31     0.08      Inf      29.86 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.19      0.32    -0.72      Inf       0.38 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"label11>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (label11) > 0     -0.6      0.44    -1.32      Inf        0.1 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"freeEn1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (freeEn1) > 0    -0.15      0.34    -0.71      Inf        0.5 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"ant1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (ant1) > 0     0.15      0.29    -0.33      Inf       2.26 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"c7ad1>0",alpha=0.05)
## Hypothesis Tests for class b:
##             Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (c7ad1) > 0     0.48      0.32    -0.04      Inf      15.08 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit3)

2.9 Model 2.2: policy combination: persistence

prior=get_prior(formula=highper~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b*p, family="bernoulli", data=data1)
## Warning: Rows containing NAs were excluded from the model
set.seed(1234) 
 
fit4=brm(formula=highper~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b*p, family="bernoulli", data=data1, chains=5, iter=2000, warmup=1000, prior=prior)
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 1.031 seconds (Warm-up)
##                0.956 seconds (Sampling)
##                1.987 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.988 seconds (Warm-up)
##                0.969 seconds (Sampling)
##                1.957 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.96 seconds (Warm-up)
##                0.977 seconds (Sampling)
##                1.937 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 1.015 seconds (Warm-up)
##                0.978 seconds (Sampling)
##                1.993 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 5).
## 
## Chain 5, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 5, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 5, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 5, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 5, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 5, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 5, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 5, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 5, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 5, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 5, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 5, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 1.156 seconds (Warm-up)
##                1.676 seconds (Sampling)
##                2.832 seconds (Total)
summary(fit4)
##  Family: bernoulli (logit) 
## Formula: highper ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b * p 
##    Data: data1 (Number of observations: 248) 
## Samples: 5 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 5000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept         -1.60      0.67    -2.93    -0.32       5000    1
## age_group12        0.47      0.44    -0.40     1.35       4826    1
## age_group13        0.10      0.47    -0.81     1.01       4182    1
## age_group14       -0.13      0.53    -1.16     0.93       4232    1
## educ22            -0.10      0.42    -0.92     0.71       4434    1
## educ23             0.90      0.49    -0.05     1.88       4773    1
## d1amarried        -0.07      0.41    -0.88     0.74       4429    1
## h11                0.24      0.31    -0.35     0.86       5000    1
## selfhealthgood     0.73      0.29     0.20     1.29       5000    1
## smosttmedium       0.33      0.38    -0.41     1.06       5000    1
## smosttheavy        0.68      0.41    -0.12     1.47       5000    1
## b18abad            0.59      0.31    -0.01     1.21       5000    1
## b6b1              -0.03      0.61    -1.20     1.17       3827    1
## p1                 0.44      0.43    -0.40     1.28       5000    1
## p2                 0.12      0.43    -0.71     0.97       4661    1
## b6b1:p1           -0.79      0.81    -2.36     0.81       3897    1
## b6b1:p2            0.28      0.78    -1.22     1.82       3935    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0     0.03      0.05    -0.06      Inf       2.27 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.01      0.06     -0.1      Inf       0.84 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     0.01      0.08    -0.12      Inf       1.21 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0    -0.07      0.41    -0.75      Inf       0.77 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (h11) > 0     0.24      0.31    -0.26      Inf       3.47 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0     -0.1      0.42     -0.8      Inf       0.69 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (educ23) > 0      0.9      0.49     0.09      Inf      30.65 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (selfhealthgood) > 0     0.73      0.29     0.27      Inf     191.31 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.33      0.38     -0.3      Inf       4.09 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (smosttheavy) > 0     0.68      0.41     0.01      Inf      20.19 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (b18abad) > 0     0.59      0.31     0.09      Inf      35.23 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.03      0.61    -1.02      Inf       0.93 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p1) > 0     0.44      0.43    -0.28      Inf       5.47 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p2) > 0     0.12      0.43    -0.58      Inf       1.51 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6b1:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p1) > 0    -0.79      0.81    -2.11      Inf        0.2 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6b1:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p2) > 0     0.28      0.78       -1      Inf       1.76 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit4)

3 model for income=1

3.1 Model 1.1: model for cost-single policy

data2=subset(data, in00==1)
            
fit1 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b+label1+freeEn+ant+c7ad, quantile = 0.25), data = data2, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.306 seconds (Warm-up)
##                3.302 seconds (Sampling)
##                6.608 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.897 seconds (Warm-up)
##                2.664 seconds (Sampling)
##                6.561 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.914 seconds (Warm-up)
##                4.531 seconds (Sampling)
##                7.445 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.145 seconds (Warm-up)
##                3.084 seconds (Sampling)
##                6.229 seconds (Total)
summary(fit1)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b + label1 + freeEn + ant + c7ad 
##          quantile = 0.25
##    Data: data2 (Number of observations: 187) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.65      0.07     4.50     4.79       2532    1
## age_group12       -0.07      0.09    -0.27     0.08       2043    1
## age_group13       -0.14      0.07    -0.28     0.00       1630    1
## age_group14       -0.10      0.07    -0.23     0.04       1584    1
## educ22            -0.01      0.04    -0.09     0.08       2265    1
## educ23             0.09      0.06    -0.03     0.20       2021    1
## d1amarried         0.01      0.06    -0.12     0.13       1604    1
## h11                0.05      0.04    -0.02     0.12       2699    1
## selfhealthgood     0.06      0.03    -0.01     0.13       3123    1
## smosttmedium       0.07      0.05    -0.04     0.17       2069    1
## smosttheavy       -0.01      0.05    -0.12     0.10       2433    1
## b18abad            0.00      0.04    -0.07     0.07       2348    1
## b6b1              -0.02      0.04    -0.09     0.05       3174    1
## label11           -0.01      0.04    -0.09     0.07       2690    1
## freeEn1           -0.11      0.04    -0.19    -0.02       2442    1
## ant1               0.05      0.04    -0.02     0.11       2940    1
## c7ad1             -0.06      0.04    -0.13     0.01       2561    1
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     0.07      0.01     0.06     0.08       3497    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
#evidence ratio



hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0    -0.07      0.09    -0.23      Inf       0.25 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.14      0.07    -0.26      Inf       0.02 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     -0.1      0.07    -0.21      Inf       0.08 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0     0.01      0.06     -0.1      Inf       1.16 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (h11) > 0     0.05      0.04    -0.01      Inf      12.33 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0    -0.01      0.04    -0.08      Inf       0.68 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ23) > 0     0.09      0.06    -0.01      Inf      13.87 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (selfhealthgood) > 0     0.06      0.03        0      Inf      24.48 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.07      0.05    -0.02      Inf       8.13 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0    -0.01      0.05     -0.1      Inf       0.66 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b18abad) > 0        0      0.04    -0.06      Inf       0.96 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.02      0.04    -0.07      Inf       0.48 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"label11>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (label11) > 0    -0.01      0.04    -0.08      Inf       0.69 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"freeEn1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (freeEn1) > 0    -0.11      0.04    -0.18      Inf       0.01 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"ant1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (ant1) > 0     0.05      0.04    -0.01      Inf      10.24 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"c7ad1>0",alpha=0.05)
## Hypothesis Tests for class b:
##             Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (c7ad1) > 0    -0.06      0.04    -0.12      Inf       0.05 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)

3.2 Model 1.1: model for cost-single policy -0.5

fit1 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b+label1+freeEn+ant+c7ad, quantile = 0.5), data = data2, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.574 seconds (Warm-up)
##                2.436 seconds (Sampling)
##                5.01 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.373 seconds (Warm-up)
##                2.412 seconds (Sampling)
##                4.785 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.28 seconds (Warm-up)
##                2.671 seconds (Sampling)
##                4.951 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 2.618 seconds (Warm-up)
##                2.477 seconds (Sampling)
##                5.095 seconds (Total)
summary(fit1)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b + label1 + freeEn + ant + c7ad 
##          quantile = 0.5
##    Data: data2 (Number of observations: 187) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.73      0.07     4.59     4.87       2367    1
## age_group12       -0.03      0.07    -0.18     0.11       2133    1
## age_group13       -0.14      0.07    -0.28     0.00       1751    1
## age_group14       -0.08      0.06    -0.21     0.05       1672    1
## educ22             0.00      0.05    -0.09     0.09       1981    1
## educ23             0.10      0.06    -0.02     0.22       1842    1
## d1amarried         0.01      0.05    -0.10     0.12       1800    1
## h11                0.08      0.04     0.00     0.15       2921    1
## selfhealthgood     0.05      0.03    -0.02     0.11       3325    1
## smosttmedium       0.07      0.05    -0.02     0.16       2024    1
## smosttheavy        0.03      0.05    -0.07     0.14       1805    1
## b18abad            0.03      0.04    -0.04     0.10       3221    1
## b6b1              -0.03      0.03    -0.10     0.04       2979    1
## label11           -0.03      0.05    -0.13     0.06       2854    1
## freeEn1           -0.10      0.04    -0.19    -0.02       3001    1
## ant1               0.05      0.04    -0.03     0.11       2694    1
## c7ad1             -0.07      0.03    -0.14    -0.01       2887    1
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     0.09      0.01     0.08      0.1       3350    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
#evidence ratio



hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0    -0.03      0.07    -0.16      Inf        0.5 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.14      0.07    -0.26      Inf       0.03 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0    -0.08      0.06    -0.18      Inf       0.13 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0     0.01      0.05    -0.08      Inf        1.6 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (h11) > 0     0.08      0.04     0.02      Inf      46.62 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0        0      0.05    -0.08      Inf       0.89 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ23) > 0      0.1      0.06    -0.01      Inf      16.09 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (selfhealthgood) > 0     0.05      0.03        0      Inf      14.75 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.07      0.05    -0.01      Inf      13.55 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0     0.03      0.05    -0.05      Inf       2.84 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b18abad) > 0     0.03      0.04    -0.03      Inf       4.55 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.03      0.03    -0.09      Inf       0.21 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"label11>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (label11) > 0    -0.03      0.05    -0.11      Inf       0.34 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"freeEn1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (freeEn1) > 0     -0.1      0.04    -0.17      Inf       0.01 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"ant1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (ant1) > 0     0.05      0.04    -0.01      Inf       8.69 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"c7ad1>0",alpha=0.05)
## Hypothesis Tests for class b:
##             Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (c7ad1) > 0    -0.07      0.03    -0.13      Inf       0.01 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)

3.3 Model 1.1: model for cost-single policy -0.75

fit1 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b+label1+freeEn+ant+c7ad, quantile = 0.75), data = data2, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.822 seconds (Warm-up)
##                3.693 seconds (Sampling)
##                7.515 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 4.338 seconds (Warm-up)
##                3.013 seconds (Sampling)
##                7.351 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.604 seconds (Warm-up)
##                3.704 seconds (Sampling)
##                7.308 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.304 seconds (Warm-up)
##                3.63 seconds (Sampling)
##                6.934 seconds (Total)
summary(fit1)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b + label1 + freeEn + ant + c7ad 
##          quantile = 0.75
##    Data: data2 (Number of observations: 187) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.90      0.08     4.74     5.06       2180    1
## age_group12       -0.02      0.09    -0.19     0.17       2118    1
## age_group13       -0.15      0.08    -0.31     0.02       1735    1
## age_group14       -0.10      0.07    -0.24     0.04       1687    1
## educ22             0.00      0.05    -0.09     0.11       2108    1
## educ23             0.09      0.07    -0.05     0.22       1957    1
## d1amarried         0.00      0.06    -0.12     0.11       1667    1
## h11                0.08      0.04     0.00     0.16       3112    1
## selfhealthgood     0.04      0.04    -0.03     0.11       3603    1
## smosttmedium       0.03      0.05    -0.06     0.13       2548    1
## smosttheavy        0.12      0.05     0.02     0.22       2807    1
## b18abad            0.03      0.04    -0.05     0.11       2882    1
## b6b1              -0.03      0.04    -0.11     0.05       2203    1
## label11            0.04      0.06    -0.07     0.15       2654    1
## freeEn1           -0.05      0.05    -0.15     0.04       3201    1
## ant1               0.01      0.04    -0.08     0.09       3054    1
## c7ad1             -0.08      0.05    -0.17     0.01       2327    1
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     0.08      0.01     0.07     0.09       4000    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
#evidence ratio



hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0    -0.02      0.09    -0.17      Inf       0.62 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.15      0.08    -0.28      Inf       0.04 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     -0.1      0.07    -0.22      Inf       0.08 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0        0      0.06     -0.1      Inf       1.11 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (h11) > 0     0.08      0.04     0.02      Inf      40.24 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0        0      0.05    -0.08      Inf       1.09 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ23) > 0     0.09      0.07    -0.03      Inf       7.71 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (selfhealthgood) > 0     0.04      0.04    -0.02      Inf       6.49 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.03      0.05    -0.05      Inf        2.8 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (smosttheavy) > 0     0.12      0.05     0.03      Inf      75.92 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b18abad) > 0     0.03      0.04    -0.04      Inf       3.15 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.03      0.04    -0.09      Inf       0.35 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"label11>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (label11) > 0     0.04      0.06    -0.05      Inf       3.49 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"freeEn1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (freeEn1) > 0    -0.05      0.05    -0.13      Inf       0.15 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"ant1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (ant1) > 0     0.01      0.04    -0.06      Inf       1.27 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"c7ad1>0",alpha=0.05)
## Hypothesis Tests for class b:
##             Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (c7ad1) > 0    -0.08      0.05    -0.15      Inf       0.04 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)

WAIC(fit, fit10, fit100)

3.4 Model 1.2: model for cost-policy combination

fit2 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b*p, quantile = 0.25), data = data2, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 4.614 seconds (Warm-up)
##                5.024 seconds (Sampling)
##                9.638 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 5.79 seconds (Warm-up)
##                4.478 seconds (Sampling)
##                10.268 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 6.418 seconds (Warm-up)
##                4.853 seconds (Sampling)
##                11.271 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 5.598 seconds (Warm-up)
##                4.832 seconds (Sampling)
##                10.43 seconds (Total)
summary(fit2)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b * p 
##          quantile = 0.25
##    Data: data2 (Number of observations: 187) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.65      0.09     4.47     4.82       1504 1.00
## age_group12       -0.14      0.08    -0.30     0.03       1997 1.00
## age_group13       -0.16      0.07    -0.30    -0.03       1481 1.00
## age_group14       -0.11      0.07    -0.23     0.02       1338 1.00
## educ22            -0.03      0.05    -0.11     0.06       1771 1.00
## educ23             0.03      0.06    -0.09     0.16       1436 1.01
## d1amarried         0.05      0.06    -0.07     0.17       1362 1.00
## h11                0.06      0.04    -0.02     0.13       2737 1.00
## selfhealthgood     0.05      0.04    -0.02     0.13       2348 1.00
## smosttmedium       0.07      0.05    -0.03     0.17       1631 1.01
## smosttheavy        0.00      0.06    -0.11     0.11       1417 1.01
## b18abad           -0.04      0.03    -0.10     0.03       2659 1.00
## b6b1               0.02      0.09    -0.17     0.19       1026 1.00
## p1                -0.02      0.06    -0.14     0.09       1418 1.00
## p2                 0.00      0.06    -0.13     0.12       1349 1.00
## b6b1:p1            0.02      0.11    -0.20     0.23       1084 1.00
## b6b1:p2           -0.09      0.10    -0.29     0.11        966 1.01
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     0.07      0.01     0.06     0.08       2928    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
#evidence ratio



hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0    -0.02      0.09    -0.17      Inf       0.62 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.15      0.08    -0.28      Inf       0.04 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     -0.1      0.07    -0.22      Inf       0.08 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0     0.05      0.06    -0.05      Inf       4.01 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (h11) > 0     0.06      0.04    -0.01      Inf      13.34 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0    -0.03      0.05     -0.1      Inf       0.39 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ23) > 0     0.03      0.06    -0.07      Inf       2.04 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (selfhealthgood) > 0     0.05      0.04    -0.01      Inf      11.74 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.07      0.05    -0.02      Inf       9.75 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0        0      0.06    -0.09      Inf       1.03 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b18abad) > 0    -0.04      0.03    -0.09      Inf       0.16 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0     0.02      0.09    -0.14      Inf       1.37 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p1) > 0    -0.02      0.06    -0.13      Inf       0.53 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p2) > 0        0      0.06    -0.11      Inf          1 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p1) > 0     0.02      0.11    -0.16      Inf       1.26 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p2) > 0    -0.09       0.1    -0.26      Inf       0.24 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)

3.5 Model 1.2: model for cost-policy combination p=0.5

fit2 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b*p, quantile = 0.5), data = data2, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.609 seconds (Warm-up)
##                2.741 seconds (Sampling)
##                6.35 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 4.041 seconds (Warm-up)
##                4.874 seconds (Sampling)
##                8.915 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 4.728 seconds (Warm-up)
##                2.795 seconds (Sampling)
##                7.523 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.421 seconds (Warm-up)
##                3.011 seconds (Sampling)
##                6.432 seconds (Total)
summary(fit2)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b * p 
##          quantile = 0.5
##    Data: data2 (Number of observations: 187) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.77      0.08     4.61     4.92       1896    1
## age_group12       -0.02      0.08    -0.18     0.13       2128    1
## age_group13       -0.14      0.07    -0.28     0.00       1632    1
## age_group14       -0.08      0.07    -0.20     0.05       1489    1
## educ22            -0.01      0.05    -0.10     0.08       1968    1
## educ23             0.08      0.07    -0.04     0.21       1677    1
## d1amarried         0.04      0.05    -0.07     0.14       1921    1
## h11                0.06      0.04    -0.01     0.13       3219    1
## selfhealthgood     0.05      0.04    -0.03     0.12       2981    1
## smosttmedium       0.07      0.04    -0.02     0.16       2423    1
## smosttheavy        0.05      0.05    -0.05     0.15       2518    1
## b18abad           -0.01      0.04    -0.08     0.06       3110    1
## b6b1               0.01      0.07    -0.13     0.16       1826    1
## p1                -0.05      0.06    -0.16     0.06       2296    1
## p2                -0.07      0.05    -0.18     0.03       2124    1
## b6b1:p1           -0.04      0.09    -0.23     0.14       2053    1
## b6b1:p2           -0.06      0.09    -0.24     0.11       1749    1
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     0.09      0.01     0.08     0.11       3399    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
marginal_effects(fit2)

#evidence ratio



hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0    -0.02      0.09    -0.17      Inf       0.62 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.15      0.08    -0.28      Inf       0.04 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     -0.1      0.07    -0.22      Inf       0.08 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0     0.04      0.05    -0.05      Inf          3 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (h11) > 0     0.06      0.04        0      Inf      19.94 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0    -0.01      0.05    -0.08      Inf       0.81 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ23) > 0     0.08      0.07    -0.03      Inf       8.64 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (selfhealthgood) > 0     0.05      0.04    -0.01      Inf       8.98 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.07      0.04        0      Inf      18.14 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0     0.05      0.05    -0.03      Inf       4.66 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b18abad) > 0    -0.01      0.04    -0.07      Inf       0.67 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0     0.01      0.07    -0.11      Inf       1.28 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p1) > 0    -0.05      0.06    -0.14      Inf        0.2 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p2) > 0    -0.07      0.05    -0.16      Inf       0.09 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p1) > 0    -0.04      0.09     -0.2      Inf       0.49 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p2) > 0    -0.06      0.09    -0.21      Inf       0.31 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)

3.6 Model 1.2: model for cost-policy combination p=0.75

fit2 <- brm(bf(logC1~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b*p, quantile = 0.75), data = data2, 
            family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.854 seconds (Warm-up)
##                3.688 seconds (Sampling)
##                7.542 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.404 seconds (Warm-up)
##                4.643 seconds (Sampling)
##                8.047 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.429 seconds (Warm-up)
##                3.08 seconds (Sampling)
##                6.509 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'asym_laplace(identity) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 3.441 seconds (Warm-up)
##                3.114 seconds (Sampling)
##                6.555 seconds (Total)
summary(fit2)
##  Family: asym_laplace (identity) 
## Formula: logC1 ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b * p 
##          quantile = 0.75
##    Data: data2 (Number of observations: 187) 
## Samples: 4 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 4000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept          4.92      0.09     4.75     5.11       1980    1
## age_group12       -0.03      0.09    -0.20     0.17       1609    1
## age_group13       -0.18      0.08    -0.33    -0.01       1410    1
## age_group14       -0.10      0.07    -0.24     0.04       1328    1
## educ22            -0.02      0.05    -0.11     0.07       2342    1
## educ23             0.08      0.07    -0.06     0.22       1850    1
## d1amarried         0.02      0.06    -0.11     0.12       1364    1
## h11                0.08      0.04     0.01     0.16       3562    1
## selfhealthgood     0.04      0.04    -0.04     0.11       3189    1
## smosttmedium       0.01      0.05    -0.08     0.10       2159    1
## smosttheavy        0.09      0.05    -0.01     0.20       2348    1
## b18abad            0.01      0.04    -0.07     0.09       2901    1
## b6b1               0.07      0.08    -0.09     0.23       1562    1
## p1                 0.00      0.06    -0.13     0.12       1809    1
## p2                -0.03      0.06    -0.16     0.08       1957    1
## b6b1:p1           -0.14      0.11    -0.36     0.08       1738    1
## b6b1:p2           -0.12      0.10    -0.30     0.07       1698    1
## 
## Family Specific Parameters: 
##       Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma     0.08      0.01     0.06     0.09       3333    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
marginal_effects(fit2)

#evidence ratio



hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0    -0.02      0.09    -0.17      Inf       0.62 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.15      0.08    -0.28      Inf       0.04 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     -0.1      0.07    -0.22      Inf       0.08 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0     0.02      0.06    -0.09      Inf       1.67 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (h11) > 0     0.08      0.04     0.02      Inf       58.7 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0    -0.02      0.05     -0.1      Inf       0.49 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ23) > 0     0.08      0.07    -0.03      Inf       7.49 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (selfhealthgood) > 0     0.04      0.04    -0.02      Inf       6.03 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.01      0.05    -0.07      Inf       1.28 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (smosttheavy) > 0     0.09      0.05     0.01      Inf      24.32 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b18abad) > 0     0.01      0.04    -0.06      Inf       1.32 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0     0.07      0.08    -0.06      Inf       4.42 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p1) > 0        0      0.06     -0.1      Inf       1.12 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p2) > 0    -0.03      0.06    -0.14      Inf        0.4 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p1) > 0    -0.14      0.11    -0.32      Inf       0.11 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6b1:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p2) > 0    -0.12       0.1    -0.27      Inf       0.13 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)

#Model 2: model for persistence

3.7 Model 2.1: single policy

prior=get_prior(formula=highper~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b+label1+freeEn+ant+c7ad, family="bernoulli", data=data2)
## Warning: Rows containing NAs were excluded from the model
set.seed(1234) 
 
fit3=brm(formula=highper~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b+label1+freeEn+ant+c7ad, family="bernoulli", data=data2, chains=5, iter=2000, warmup=1000, prior=prior)
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.695 seconds (Warm-up)
##                0.728 seconds (Sampling)
##                1.423 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.729 seconds (Warm-up)
##                0.725 seconds (Sampling)
##                1.454 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.668 seconds (Warm-up)
##                0.647 seconds (Sampling)
##                1.315 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.702 seconds (Warm-up)
##                0.714 seconds (Sampling)
##                1.416 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 5).
## 
## Chain 5, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 5, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 5, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 5, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 5, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 5, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 5, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 5, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 5, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 5, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 5, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 5, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.681 seconds (Warm-up)
##                0.705 seconds (Sampling)
##                1.386 seconds (Total)
summary(fit3)
##  Family: bernoulli (logit) 
## Formula: highper ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b + label1 + freeEn + ant + c7ad 
##    Data: data2 (Number of observations: 187) 
## Samples: 5 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 5000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept         -1.18      0.76    -2.69     0.28       4373    1
## age_group12       -0.14      0.80    -1.72     1.43       4178    1
## age_group13       -1.34      0.76    -2.91     0.09       3639    1
## age_group14       -0.85      0.66    -2.18     0.38       3376    1
## educ22             0.16      0.46    -0.74     1.07       4649    1
## educ23             1.21      0.63     0.00     2.47       4080    1
## d1amarried         0.20      0.61    -0.92     1.42       3541    1
## h11                0.89      0.38     0.18     1.65       5000    1
## selfhealthgood     0.55      0.36    -0.12     1.27       5000    1
## smosttmedium       0.41      0.50    -0.54     1.40       4236    1
## smosttheavy        0.51      0.53    -0.54     1.53       4059    1
## b18abad            0.36      0.39    -0.39     1.11       5000    1
## b6b1              -0.16      0.37    -0.88     0.55       5000    1
## label11           -0.19      0.48    -1.12     0.75       5000    1
## freeEn1           -1.03      0.43    -1.89    -0.20       5000    1
## ant1               0.29      0.39    -0.48     1.07       5000    1
## c7ad1             -0.33      0.38    -1.08     0.41       5000    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0    -0.02      0.09    -0.17      Inf       0.62 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.15      0.08    -0.28      Inf       0.04 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     -0.1      0.07    -0.22      Inf       0.08 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0      0.2      0.61    -0.78      Inf       1.61 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (h11) > 0     0.89      0.38     0.29      Inf     137.89 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0     0.16      0.46    -0.59      Inf        1.8 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (educ23) > 0     1.21      0.63     0.18      Inf      38.37 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (selfhealthgood) > 0     0.55      0.36    -0.02      Inf      16.61 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.41       0.5    -0.41      Inf       3.96 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0     0.51      0.53    -0.35      Inf       5.07 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b18abad) > 0     0.36      0.39    -0.27      Inf       4.53 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.16      0.37    -0.78      Inf       0.49 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"label11>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (label11) > 0    -0.19      0.48    -0.97      Inf       0.54 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"freeEn1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (freeEn1) > 0    -1.03      0.43    -1.75      Inf       0.01 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"ant1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (ant1) > 0     0.29      0.39    -0.35      Inf       3.39 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"c7ad1>0",alpha=0.05)
## Hypothesis Tests for class b:
##             Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (c7ad1) > 0    -0.33      0.38    -0.95      Inf       0.24 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit3)

3.8 Model 2.2: policy combination: persistence

prior=get_prior(formula=highper~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b*p, family="bernoulli", data=data2)
## Warning: Rows containing NAs were excluded from the model
set.seed(1234) 
 
fit4=brm(formula=highper~age_group1+educ2+d1a+h1+selfhealth+smostt
               +b18a+b6b*p, family="bernoulli", data=data2, chains=5, iter=2000, warmup=1000, prior=prior)
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 1).
## 
## Chain 1, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 1, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 1, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 1, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 1, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 1, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 1, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 1, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 1, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 1, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 1, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 1, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.892 seconds (Warm-up)
##                0.828 seconds (Sampling)
##                1.72 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 2).
## 
## Chain 2, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 2, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 2, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 2, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 2, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 2, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 2, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 2, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 2, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 2, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 2, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 2, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.86 seconds (Warm-up)
##                0.812 seconds (Sampling)
##                1.672 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 3).
## 
## Chain 3, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 3, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 3, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 3, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 3, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 3, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 3, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 3, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 3, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 3, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 3, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 3, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.861 seconds (Warm-up)
##                0.874 seconds (Sampling)
##                1.735 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 4).
## 
## Chain 4, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 4, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 4, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 4, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 4, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 4, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 4, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 4, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 4, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 4, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 4, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 4, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.875 seconds (Warm-up)
##                0.813 seconds (Sampling)
##                1.688 seconds (Total)
## 
## 
## SAMPLING FOR MODEL 'bernoulli(logit) brms-model' NOW (CHAIN 5).
## 
## Chain 5, Iteration:    1 / 2000 [  0%]  (Warmup)
## Chain 5, Iteration:  200 / 2000 [ 10%]  (Warmup)
## Chain 5, Iteration:  400 / 2000 [ 20%]  (Warmup)
## Chain 5, Iteration:  600 / 2000 [ 30%]  (Warmup)
## Chain 5, Iteration:  800 / 2000 [ 40%]  (Warmup)
## Chain 5, Iteration: 1000 / 2000 [ 50%]  (Warmup)
## Chain 5, Iteration: 1001 / 2000 [ 50%]  (Sampling)
## Chain 5, Iteration: 1200 / 2000 [ 60%]  (Sampling)
## Chain 5, Iteration: 1400 / 2000 [ 70%]  (Sampling)
## Chain 5, Iteration: 1600 / 2000 [ 80%]  (Sampling)
## Chain 5, Iteration: 1800 / 2000 [ 90%]  (Sampling)
## Chain 5, Iteration: 2000 / 2000 [100%]  (Sampling)
##  Elapsed Time: 0.922 seconds (Warm-up)
##                1.003 seconds (Sampling)
##                1.925 seconds (Total)
summary(fit4)
##  Family: bernoulli (logit) 
## Formula: highper ~ age_group1 + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6b * p 
##    Data: data2 (Number of observations: 187) 
## Samples: 5 chains, each with iter = 2000; warmup = 1000; thin = 1; 
##          total post-warmup samples = 5000
##    WAIC: Not computed
##  
## Population-Level Effects: 
##                Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## Intercept         -0.70      0.81    -2.30     0.89       5000    1
## age_group12       -0.01      0.79    -1.55     1.59       5000    1
## age_group13       -1.40      0.76    -2.92     0.04       4113    1
## age_group14       -0.82      0.67    -2.15     0.47       3680    1
## educ22             0.09      0.45    -0.80     0.98       5000    1
## educ23             0.93      0.64    -0.30     2.19       5000    1
## d1amarried         0.31      0.59    -0.81     1.48       4123    1
## h11                0.91      0.38     0.19     1.66       5000    1
## selfhealthgood     0.54      0.36    -0.17     1.22       5000    1
## smosttmedium       0.49      0.49    -0.43     1.50       5000    1
## smosttheavy        0.54      0.52    -0.45     1.55       5000    1
## b18abad            0.15      0.36    -0.56     0.85       5000    1
## b6b1              -0.12      0.76    -1.58     1.38       3078    1
## p1                -1.04      0.58    -2.19     0.11       3962    1
## p2                -0.70      0.58    -1.88     0.43       4334    1
## b6b1:p1            0.35      0.99    -1.60     2.27       3527    1
## b6b1:p2           -0.39      0.92    -2.17     1.40       3177    1
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).
hypothesis(fit1,"age_group12>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group12) > 0    -0.02      0.09    -0.17      Inf       0.62 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group13 >0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group13) > 0    -0.15      0.08    -0.28      Inf       0.04 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group14>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (age_group14) > 0     -0.1      0.07    -0.22      Inf       0.08 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
##                  Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (d1amarried) > 0     0.31      0.59    -0.64      Inf       2.34 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
##           Estimate Est.Error l-95% CI u-95% CI Evid.Ratio  
## (h11) > 0     0.91      0.38     0.31      Inf     146.06 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ22) > 0     0.09      0.45    -0.66      Inf       1.37 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
##              Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (educ23) > 0     0.93      0.64    -0.11      Inf      12.89 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
##                      Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (selfhealthgood) > 0     0.54      0.36    -0.05      Inf      13.84 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
##                    Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttmedium) > 0     0.49      0.49     -0.3      Inf        5.3 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
##                   Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (smosttheavy) > 0     0.54      0.52    -0.31      Inf        5.5 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b18abad) > 0     0.15      0.36    -0.45      Inf        1.9 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6b1>0",alpha=0.05)
## Hypothesis Tests for class b:
##            Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1) > 0    -0.12      0.76    -1.34      Inf       0.73 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p1) > 0    -1.04      0.58       -2      Inf       0.04 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##          Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (p2) > 0     -0.7      0.58    -1.66      Inf       0.13 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6b1:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p1) > 0     0.35      0.99    -1.29      Inf       1.77 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6b1:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
##               Estimate Est.Error l-95% CI u-95% CI Evid.Ratio 
## (b6b1:p2) > 0    -0.39      0.92    -1.89      Inf       0.51 
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit4)

LS0tDQp0aXRsZTogJ2FsbCBtb2RlbHM6IGNpZ2FyZXR0ZSBwcmljZScNCmF1dGhvcjogIkJpbmggVGhhbmcsIFRyYW4iDQpkYXRlOiAiMjMgSnVseSAyMDE3Ig0Kb3V0cHV0OiANCiAgaHRtbF9kb2N1bWVudDogDQogICAgY29kZV9kb3dubG9hZDogdHJ1ZQ0KICAgIGNvZGVfZm9sZGluZzogaGlkZQ0KICAgIG51bWJlcl9zZWN0aW9uczogeWVzDQogICAgdGhlbWU6IGpvdXJuYWwNCiAgICB0b2M6IFRSVUUNCiAgICB0b2NfZmxvYXQ6IFRSVUUNCi0tLQ0KYGBge3IgfQ0KbGl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