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/dataR5.dta")
r1 <- subset(r )
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, 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
newdata2$age_group=as.factor(newdata2$age_group)
newdata2$educ2=as.factor(newdata2$educ2)
newdata2$h1=as.factor(newdata2$h1)
newdata2$d1a=as.factor(newdata2$d1a)
newdata2$selfhealth=as.factor(newdata2$selfhealth)
newdata2$b18a=as.factor(newdata2$b18a)
newdata2$b16a=as.factor(newdata2$b16a)
newdata2$b6a=as.factor(newdata2$b6a)
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, 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, 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
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
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
data1=subset(newdata2, in00==0)
fit1 <- brm(bf(logC1~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a+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: 3.135 seconds (Warm-up)
## 3.013 seconds (Sampling)
## 6.148 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.775 seconds (Warm-up)
## 2.862 seconds (Sampling)
## 5.637 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.662 seconds (Warm-up)
## 2.322 seconds (Sampling)
## 4.984 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.724 seconds (Warm-up)
## 1.826 seconds (Sampling)
## 4.55 seconds (Total)
summary(fit1)
## Family: asym_laplace (identity)
## Formula: logC1 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a + 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.47 0.05 4.36 4.57 2499 1
## age_groupgr3039 0.06 0.04 -0.01 0.14 2449 1
## age_groupgr4049 0.04 0.04 -0.04 0.12 1885 1
## age_groupgr5059 -0.03 0.05 -0.14 0.07 2241 1
## age_group60plus -0.12 0.12 -0.38 0.10 2566 1
## educ22 0.05 0.04 -0.03 0.13 1988 1
## educ23 0.13 0.04 0.04 0.21 1718 1
## d1amarried -0.01 0.04 -0.08 0.06 2575 1
## h11 0.01 0.03 -0.05 0.06 2624 1
## selfhealthgood 0.09 0.03 0.04 0.14 3083 1
## smosttmedium 0.05 0.03 -0.02 0.11 2565 1
## smosttheavy 0.05 0.04 -0.02 0.12 2431 1
## b18abad 0.07 0.03 0.01 0.13 2443 1
## b6ayes 0.01 0.04 -0.07 0.09 2987 1
## label11 -0.08 0.04 -0.14 -0.01 2973 1
## freeEn1 -0.04 0.03 -0.11 0.02 2487 1
## ant1 0.02 0.03 -0.03 0.07 2733 1
## c7ad1 0.03 0.03 -0.02 0.08 3231 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 0.07 0 0.06 0.08 3127 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_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 0.06 0.04 0 Inf 23.39 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 0.04 0.04 -0.03 Inf 4.37
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 -0.03 0.05 -0.13 Inf 0.37
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -0.12 0.12 -0.34 Inf 0.2
## ---
## '*': 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.57
## ---
## '*': 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.42
## ---
## '*': 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 9.84
## ---
## '*': 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.06 Inf 570.43 *
## ---
## '*': 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.05 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.05 0.03 -0.01 Inf 10.94
## ---
## '*': 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.04 -0.01 Inf 11.2
## ---
## '*': 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 101.56 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 0.01 0.04 -0.06 Inf 1.82
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
a=hypothesis(fit1,"label11>0",alpha=0.05)
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.03 Inf 3.25
## ---
## '*': 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.01 Inf 5.87
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)
fit1 <- brm(bf(logC2~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a+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: 7.684 seconds (Warm-up)
## 1.972 seconds (Sampling)
## 9.656 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: 8.172 seconds (Warm-up)
## 1.969 seconds (Sampling)
## 10.141 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.51 seconds (Warm-up)
## 2.619 seconds (Sampling)
## 9.129 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: 7.016 seconds (Warm-up)
## 2.651 seconds (Sampling)
## 9.667 seconds (Total)
summary(fit1)
## Family: asym_laplace (identity)
## Formula: logC2 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a + 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 39.66 12.43 15.13 64.05 2597 1
## age_groupgr3039 13.20 8.31 -2.38 29.95 2285 1
## age_groupgr4049 0.40 8.23 -15.91 16.49 2192 1
## age_groupgr5059 5.10 12.48 -17.95 30.85 2043 1
## age_group60plus 3.45 23.31 -35.47 59.16 2531 1
## educ22 2.43 9.12 -16.21 19.73 2063 1
## educ23 18.95 10.32 -1.95 38.40 2111 1
## d1amarried -0.01 7.44 -14.42 14.40 2349 1
## h11 2.44 6.16 -9.77 13.80 3100 1
## selfhealthgood 11.73 5.57 1.03 22.85 3198 1
## smosttmedium 0.90 7.26 -13.50 15.11 2891 1
## smosttheavy 11.69 7.92 -3.72 27.36 2767 1
## b18abad 7.88 6.27 -4.46 19.76 2805 1
## b6ayes 5.75 8.49 -10.59 22.68 3080 1
## label11 -12.85 8.10 -28.02 2.91 3043 1
## freeEn1 -6.84 7.04 -19.99 7.55 3343 1
## ant1 2.58 6.53 -9.98 15.60 2474 1
## c7ad1 8.62 7.49 -5.80 23.62 2871 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 19.03 1.24 16.72 21.56 3984 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_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 13.2 8.31 -0.17 Inf 18.51
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 0.4 8.23 -12.88 Inf 1.07
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 5.1 12.48 -14.54 Inf 1.82
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 3.45 23.31 -29.67 Inf 1.09
## ---
## '*': 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 7.44 -12.14 Inf 0.98
## ---
## '*': 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 2.44 6.16 -8.16 Inf 1.99
## ---
## '*': 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 2.43 9.12 -12.26 Inf 1.59
## ---
## '*': 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 18.95 10.32 1.77 Inf 26.59 *
## ---
## '*': 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 11.73 5.57 2.74 Inf 65.67 *
## ---
## '*': 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.9 7.26 -11.07 Inf 1.23
## ---
## '*': 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 11.69 7.92 -0.96 Inf 13.76
## ---
## '*': 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 7.88 6.27 -2.57 Inf 8.73
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 5.75 8.49 -8.19 Inf 3.06
## ---
## '*': 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 -12.85 8.1 -25.84 Inf 0.06
## ---
## '*': 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 -6.84 7.04 -17.91 Inf 0.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 2.58 6.53 -7.87 Inf 1.82
## ---
## '*': 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 8.62 7.49 -3.41 Inf 6.81
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)
fit1 <- brm(bf(logC2~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a+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: 9.705 seconds (Warm-up)
## 2.916 seconds (Sampling)
## 12.621 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: 9.44 seconds (Warm-up)
## 3.003 seconds (Sampling)
## 12.443 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: 9.242 seconds (Warm-up)
## 3.047 seconds (Sampling)
## 12.289 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: 9.752 seconds (Warm-up)
## 3.68 seconds (Sampling)
## 13.432 seconds (Total)
summary(fit1)
## Family: asym_laplace (identity)
## Formula: logC2 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a + 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 87.82 17.81 54.40 123.82 2322 1
## age_groupgr3039 8.35 11.96 -14.98 32.43 2012 1
## age_groupgr4049 -1.17 12.92 -26.96 23.52 1869 1
## age_groupgr5059 6.03 18.80 -28.39 45.80 1795 1
## age_group60plus 32.48 42.03 -36.61 131.33 2607 1
## educ22 -13.15 14.08 -39.67 15.12 1933 1
## educ23 0.25 13.71 -26.61 26.99 2098 1
## d1amarried -1.00 11.50 -23.17 21.52 1858 1
## h11 3.54 8.40 -13.71 19.95 2734 1
## selfhealthgood 14.50 8.22 -1.80 29.99 2662 1
## smosttmedium -7.05 11.04 -29.78 13.37 2470 1
## smosttheavy 11.29 11.50 -11.08 33.13 2393 1
## b18abad 7.91 9.07 -9.86 25.73 2813 1
## b6ayes -0.15 12.12 -22.77 24.08 2852 1
## label11 -21.97 11.85 -44.34 2.60 2759 1
## freeEn1 10.40 9.42 -8.28 28.54 3038 1
## ant1 5.10 8.64 -11.96 22.09 2722 1
## c7ad1 19.19 8.19 2.97 35.06 2790 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 19.02 1.19 16.84 21.5 3416 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_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 8.35 11.96 -11.26 Inf 3.08
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 -1.17 12.92 -22.89 Inf 0.87
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 6.03 18.8 -23.07 Inf 1.6
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 32.48 42.03 -27.17 Inf 3.69
## ---
## '*': 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 -1 11.5 -19.48 Inf 0.86
## ---
## '*': 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 3.54 8.4 -10.96 Inf 2.11
## ---
## '*': 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 -13.15 14.08 -36.08 Inf 0.21
## ---
## '*': 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.25 13.71 -22 Inf 1.03
## ---
## '*': 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 14.5 8.22 0.53 Inf 21.73 *
## ---
## '*': 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 -7.05 11.04 -25.78 Inf 0.38
## ---
## '*': 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 11.29 11.5 -7.61 Inf 5.06
## ---
## '*': 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 7.91 9.07 -6.89 Inf 4.17
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 -0.15 12.12 -19.36 Inf 0.93
## ---
## '*': 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 -21.97 11.85 -41.11 Inf 0.04
## ---
## '*': 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 10.4 9.42 -5.33 Inf 6.3
## ---
## '*': 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 5.1 8.64 -9.01 Inf 2.62
## ---
## '*': 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 19.19 8.19 5.54 Inf 107.11 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)
WAIC(fit, fit10, fit100)
fit2 <- brm(bf(logC2~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a*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: 7.202 seconds (Warm-up)
## 3.784 seconds (Sampling)
## 10.986 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: 9.13 seconds (Warm-up)
## 3.674 seconds (Sampling)
## 12.804 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: 10.485 seconds (Warm-up)
## 4.533 seconds (Sampling)
## 15.018 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: 8.936 seconds (Warm-up)
## 3.78 seconds (Sampling)
## 12.716 seconds (Total)
summary(fit2)
## Family: asym_laplace (identity)
## Formula: logC2 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a * 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 25.22 7.39 10.94 39.59 2716 1
## age_groupgr3039 6.57 5.15 -3.45 16.71 2542 1
## age_groupgr4049 3.99 5.58 -6.89 15.16 2326 1
## age_groupgr5059 -3.14 6.97 -16.91 10.78 2393 1
## age_group60plus -11.17 13.94 -39.34 16.08 2589 1
## educ22 5.12 5.22 -5.13 15.62 2260 1
## educ23 14.98 5.90 3.24 26.50 2178 1
## d1amarried -1.09 5.10 -10.91 9.09 2439 1
## h11 0.62 3.88 -6.76 8.12 3203 1
## selfhealthgood 11.05 3.75 3.68 18.01 3173 1
## smosttmedium 3.92 4.75 -5.53 13.37 2693 1
## smosttheavy 5.39 4.99 -4.54 15.14 2578 1
## b18abad 9.38 4.00 1.40 17.08 2408 1
## b6ayes 2.12 16.38 -33.72 30.25 1396 1
## p1 -1.64 4.63 -10.36 7.77 2471 1
## p2 -1.79 5.17 -12.12 8.19 2329 1
## b6ayes:p1 -8.75 19.91 -45.86 31.90 1658 1
## b6ayes:p2 0.18 17.90 -32.91 37.30 1467 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 11.84 0.81 10.37 13.56 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).
marginal_effects(fit2)
#evidence ratio
hypothesis(fit2,"age_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 6.57 5.15 -1.76 Inf 9.18
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 3.99 5.58 -5.12 Inf 3.23
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 -3.14 6.97 -14.83 Inf 0.47
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -11.17 13.94 -34.24 Inf 0.25
## ---
## '*': 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 -1.09 5.1 -9.35 Inf 0.72
## ---
## '*': 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.62 3.88 -5.76 Inf 1.31
## ---
## '*': 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 5.12 5.22 -3.35 Inf 5.6
## ---
## '*': 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 14.98 5.9 5.3 Inf 132.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 11.05 3.75 4.79 Inf 999 *
## ---
## '*': 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 3.92 4.75 -3.8 Inf 4.11
## ---
## '*': 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 5.39 4.99 -2.9 Inf 5.97
## ---
## '*': 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 9.38 4 2.78 Inf 87.89 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 2.12 16.38 -25.84 Inf 1.4
## ---
## '*': 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 -1.64 4.63 -9.09 Inf 0.55
## ---
## '*': 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 -1.79 5.17 -10.54 Inf 0.55
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p1) > 0 -8.75 19.91 -40.47 Inf 0.48
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p2) > 0 0.18 17.9 -27.56 Inf 0.93
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)
fit2 <- brm(bf(logC2~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a*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: 8.315 seconds (Warm-up)
## 2.557 seconds (Sampling)
## 10.872 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: 8.807 seconds (Warm-up)
## 2.478 seconds (Sampling)
## 11.285 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: 8.482 seconds (Warm-up)
## 3.971 seconds (Sampling)
## 12.453 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: 8.313 seconds (Warm-up)
## 3.189 seconds (Sampling)
## 11.502 seconds (Total)
summary(fit2)
## Family: asym_laplace (identity)
## Formula: logC2 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a * 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 41.48 12.27 17.20 64.92 2848 1
## age_groupgr3039 10.63 8.44 -5.30 27.89 2314 1
## age_groupgr4049 0.42 8.84 -17.16 17.28 1960 1
## age_groupgr5059 0.27 11.22 -21.03 23.82 2256 1
## age_group60plus -2.26 23.12 -41.26 49.14 1959 1
## educ22 4.23 8.92 -13.60 21.24 2412 1
## educ23 18.22 10.34 -1.99 37.86 2323 1
## d1amarried -2.12 7.53 -16.90 12.50 2447 1
## h11 0.31 6.31 -12.12 12.89 2809 1
## selfhealthgood 9.96 5.87 -1.67 21.44 2885 1
## smosttmedium 1.12 7.25 -13.12 14.86 2657 1
## smosttheavy 11.69 7.69 -2.85 26.42 2458 1
## b18abad 7.57 6.42 -5.20 19.93 3468 1
## b6ayes 9.88 17.33 -25.16 43.61 1718 1
## p1 6.87 8.52 -9.58 23.62 2450 1
## p2 0.90 6.94 -13.01 14.14 2837 1
## b6ayes:p1 -14.70 23.52 -59.92 32.12 2181 1
## b6ayes:p2 1.00 23.04 -42.33 47.87 1686 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 19.19 1.24 16.9 21.79 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).
marginal_effects(fit2)
#evidence ratio
hypothesis(fit2,"age_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 10.63 8.44 -2.75 Inf 8.57
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 0.42 8.84 -14.13 Inf 1.1
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 0.27 11.22 -17.89 Inf 0.99
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -2.26 23.12 -35.69 Inf 0.71
## ---
## '*': 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 -2.12 7.53 -14.5 Inf 0.62
## ---
## '*': 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.31 6.31 -10.11 Inf 1.1
## ---
## '*': 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 4.23 8.92 -10.63 Inf 2.21
## ---
## '*': 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 18.22 10.34 1.16 Inf 24.48 *
## ---
## '*': 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 9.96 5.87 0.37 Inf 20.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 1.12 7.25 -10.98 Inf 1.32
## ---
## '*': 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 11.69 7.69 -0.9 Inf 14.09
## ---
## '*': 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 7.57 6.42 -3.02 Inf 7.33
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 9.88 17.33 -19.24 Inf 2.75
## ---
## '*': 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 6.87 8.52 -6.78 Inf 3.7
## ---
## '*': 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.9 6.94 -10.72 Inf 1.24
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p1) > 0 -14.7 23.52 -53.02 Inf 0.34
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p2) > 0 1 23.04 -35.66 Inf 1.03
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)
fit2 <- brm(bf(logC2~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a*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: 10.386 seconds (Warm-up)
## 3.5 seconds (Sampling)
## 13.886 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: 11.013 seconds (Warm-up)
## 4.127 seconds (Sampling)
## 15.14 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: 10.566 seconds (Warm-up)
## 3.357 seconds (Sampling)
## 13.923 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: 10.849 seconds (Warm-up)
## 4.685 seconds (Sampling)
## 15.534 seconds (Total)
summary(fit2)
## Family: asym_laplace (identity)
## Formula: logC2 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a * 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 78.96 18.63 43.44 115.84 1967 1
## age_groupgr3039 7.18 13.22 -18.82 32.58 1790 1
## age_groupgr4049 -1.28 13.56 -27.43 24.77 1525 1
## age_groupgr5059 5.53 21.10 -32.17 51.32 1728 1
## age_group60plus 38.53 46.81 -42.34 147.17 2048 1
## educ22 -0.41 13.41 -27.78 24.43 1762 1
## educ23 8.91 13.67 -18.04 35.44 1956 1
## d1amarried 0.26 12.13 -23.55 23.28 1734 1
## h11 -2.56 8.46 -18.60 14.65 2177 1
## selfhealthgood 11.66 8.30 -4.47 28.05 2114 1
## smosttmedium -13.50 11.42 -36.37 9.15 2365 1
## smosttheavy 11.11 12.21 -12.68 35.24 2335 1
## b18abad 10.36 9.22 -7.52 28.35 2298 1
## b6ayes -3.09 21.97 -41.79 45.41 1318 1
## p1 24.69 10.99 3.35 46.10 1893 1
## p2 10.28 10.40 -10.18 29.94 2176 1
## b6ayes:p1 -5.64 31.41 -68.34 57.02 1336 1
## b6ayes:p2 26.91 27.56 -30.15 78.63 1194 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 19.06 1.27 16.78 21.75 3114 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(fit2,"age_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 7.18 13.22 -14.54 Inf 2.37
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 -1.28 13.56 -23.22 Inf 0.86
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 5.53 21.1 -26.72 Inf 1.44
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 38.53 46.81 -32.39 Inf 4.15
## ---
## '*': 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.26 12.13 -19.87 Inf 1.04
## ---
## '*': 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 -2.56 8.46 -16.08 Inf 0.6
## ---
## '*': 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.41 13.41 -23.32 Inf 1
## ---
## '*': 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 8.91 13.67 -13.52 Inf 2.81
## ---
## '*': 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 11.66 8.3 -1.81 Inf 11.31
## ---
## '*': 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 -13.5 11.42 -32.34 Inf 0.13
## ---
## '*': 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 11.11 12.21 -9.15 Inf 4.56
## ---
## '*': 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 10.36 9.22 -4.83 Inf 6.35
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 -3.09 21.97 -35.07 Inf 0.68
## ---
## '*': 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 24.69 10.99 6.87 Inf 80.63 *
## ---
## '*': 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 10.28 10.4 -6.76 Inf 5.16
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p1) > 0 -5.64 31.41 -57.21 Inf 0.73
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p2) > 0 26.91 27.56 -18.89 Inf 5.68
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)
#Model 2: model for persistence
prior=get_prior(formula=highper~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a+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_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a+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: 0.766 seconds (Warm-up)
## 0.703 seconds (Sampling)
## 1.469 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.812 seconds (Warm-up)
## 0.719 seconds (Sampling)
## 1.531 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.844 seconds (Warm-up)
## 0.72 seconds (Sampling)
## 1.564 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.797 seconds (Warm-up)
## 0.757 seconds (Sampling)
## 1.554 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.791 seconds (Warm-up)
## 0.718 seconds (Sampling)
## 1.509 seconds (Total)
summary(fit3)
## Family: bernoulli (logit)
## Formula: highper ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a + 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.59 0.64 -2.87 -0.33 5000 1
## age_groupgr3039 0.57 0.44 -0.29 1.42 3677 1
## age_groupgr4049 0.15 0.46 -0.75 1.07 3434 1
## age_groupgr5059 0.10 0.56 -0.98 1.19 3669 1
## age_group60plus -0.27 1.04 -2.42 1.71 5000 1
## educ22 -0.23 0.42 -1.08 0.60 4297 1
## educ23 0.82 0.49 -0.13 1.78 4021 1
## d1amarried -0.16 0.41 -0.95 0.63 3712 1
## h11 0.26 0.31 -0.34 0.87 5000 1
## selfhealthgood 0.79 0.30 0.21 1.38 5000 1
## smosttmedium 0.45 0.39 -0.31 1.23 5000 1
## smosttheavy 0.80 0.40 0.00 1.61 4627 1
## b18abad 0.59 0.32 -0.02 1.22 5000 1
## b6ayes 0.45 0.44 -0.41 1.34 5000 1
## label11 -0.59 0.44 -1.47 0.26 5000 1
## freeEn1 -0.24 0.35 -0.94 0.44 5000 1
## ant1 0.13 0.30 -0.48 0.70 5000 1
## c7ad1 0.38 0.32 -0.23 1.01 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(fit3,"age_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 0.57 0.44 -0.16 Inf 8.77
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 0.15 0.46 -0.62 Inf 1.73
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 0.1 0.56 -0.81 Inf 1.35
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -0.27 1.04 -2.02 Inf 0.68
## ---
## '*': 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.16 0.41 -0.84 Inf 0.54
## ---
## '*': 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.26 0.31 -0.24 Inf 3.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.23 0.42 -0.94 Inf 0.41
## ---
## '*': 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.82 0.49 0.01 Inf 19.75 *
## ---
## '*': 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.79 0.3 0.31 Inf 237.1 *
## ---
## '*': 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.45 0.39 -0.19 Inf 7.03
## ---
## '*': 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.8 0.4 0.15 Inf 38.37 *
## ---
## '*': 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.32 0.07 Inf 32.33 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 0.45 0.44 -0.26 Inf 5.63
## ---
## '*': 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.59 0.44 -1.33 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.24 0.35 -0.82 Inf 0.32
## ---
## '*': 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.13 0.3 -0.37 Inf 2.01
## ---
## '*': 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.38 0.32 -0.13 Inf 7.65
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit3)
prior=get_prior(formula=highper~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a*p, family="bernoulli", data=data1)
## Warning: Rows containing NAs were excluded from the model
set.seed(1234)
fit4=brm(formula=highper~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a*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.373 seconds (Warm-up)
## 1.202 seconds (Sampling)
## 2.575 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.361 seconds (Warm-up)
## 1.655 seconds (Sampling)
## 3.016 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: 1.389 seconds (Warm-up)
## 1.149 seconds (Sampling)
## 2.538 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.369 seconds (Warm-up)
## 1.172 seconds (Sampling)
## 2.541 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.295 seconds (Warm-up)
## 1.269 seconds (Sampling)
## 2.564 seconds (Total)
summary(fit4)
## Family: bernoulli (logit)
## Formula: highper ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a * 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.66 -2.92 -0.32 5000 1
## age_groupgr3039 0.45 0.45 -0.41 1.36 4023 1
## age_groupgr4049 0.03 0.47 -0.92 0.94 3386 1
## age_groupgr5059 -0.04 0.56 -1.15 1.08 3441 1
## age_group60plus -0.46 1.07 -2.70 1.52 5000 1
## educ22 -0.12 0.42 -0.91 0.70 4274 1
## educ23 0.92 0.50 -0.06 1.92 4179 1
## d1amarried -0.14 0.40 -0.91 0.65 3769 1
## h11 0.17 0.30 -0.42 0.74 5000 1
## selfhealthgood 0.72 0.30 0.12 1.31 5000 1
## smosttmedium 0.37 0.38 -0.36 1.15 4556 1
## smosttheavy 0.81 0.42 0.01 1.66 4455 1
## b18abad 0.52 0.31 -0.11 1.15 5000 1
## b6ayes 2.11 1.50 -0.41 5.46 2078 1
## p1 0.35 0.38 -0.39 1.13 5000 1
## p2 0.17 0.38 -0.58 0.91 5000 1
## b6ayes:p1 -2.57 1.70 -6.20 0.54 2373 1
## b6ayes:p2 -1.49 1.62 -5.09 1.28 2159 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(fit4,"age_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 0.45 0.45 -0.29 Inf 5.39
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 0.03 0.47 -0.76 Inf 1.11
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 -0.04 0.56 -0.98 Inf 0.9
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -0.46 1.07 -2.25 Inf 0.52
## ---
## '*': 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.14 0.4 -0.78 Inf 0.58
## ---
## '*': 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.17 0.3 -0.32 Inf 2.43
## ---
## '*': 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.12 0.42 -0.81 Inf 0.63
## ---
## '*': 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.92 0.5 0.1 Inf 29.67 *
## ---
## '*': 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.72 0.3 0.23 Inf 130.58 *
## ---
## '*': 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.37 0.38 -0.24 Inf 4.99
## ---
## '*': 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.81 0.42 0.15 Inf 41.37 *
## ---
## '*': 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.52 0.31 0 Inf 18.92
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 2.11 1.5 -0.02 Inf 17.66
## ---
## '*': 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.35 0.38 -0.27 Inf 4.62
## ---
## '*': 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.17 0.38 -0.44 Inf 2.03
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6ayes:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p1) > 0 -2.57 1.7 -5.48 Inf 0.06
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6ayes:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p2) > 0 -1.49 1.62 -4.42 Inf 0.21
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit4)
data2=subset(newdata2, in00==1)
fit1 <- brm(bf(logC1~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a+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: 2.901 seconds (Warm-up)
## 3.05 seconds (Sampling)
## 5.951 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.234 seconds (Warm-up)
## 3.001 seconds (Sampling)
## 6.235 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.84 seconds (Warm-up)
## 2.316 seconds (Sampling)
## 5.156 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.896 seconds (Warm-up)
## 2.985 seconds (Sampling)
## 5.881 seconds (Total)
summary(fit1)
## Family: asym_laplace (identity)
## Formula: logC1 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a + 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.61 0.07 4.47 4.74 2321 1
## age_groupgr3039 -0.07 0.09 -0.25 0.08 1853 1
## age_groupgr4049 -0.13 0.07 -0.26 0.00 1606 1
## age_groupgr5059 -0.13 0.07 -0.27 0.00 1569 1
## age_group60plus -0.04 0.08 -0.19 0.12 1695 1
## educ22 0.00 0.04 -0.09 0.08 2218 1
## educ23 0.08 0.06 -0.03 0.19 1990 1
## d1amarried 0.01 0.06 -0.12 0.12 1396 1
## h11 0.05 0.04 -0.03 0.12 2790 1
## selfhealthgood 0.07 0.03 0.00 0.14 3065 1
## smosttmedium 0.09 0.05 -0.01 0.19 1739 1
## smosttheavy 0.01 0.06 -0.10 0.12 1783 1
## b18abad 0.00 0.04 -0.07 0.07 2581 1
## b6ayes 0.03 0.04 -0.05 0.12 2998 1
## label11 -0.02 0.04 -0.10 0.07 2937 1
## freeEn1 -0.10 0.04 -0.18 -0.02 2359 1
## ant1 0.06 0.04 -0.01 0.13 2655 1
## c7ad1 -0.06 0.04 -0.13 0.01 2488 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 3187 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_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 -0.07 0.09 -0.22 Inf 0.25
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 -0.13 0.07 -0.24 Inf 0.03
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 -0.13 0.07 -0.25 Inf 0.03
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -0.04 0.08 -0.17 Inf 0.48
## ---
## '*': 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.15
## ---
## '*': 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 9.64
## ---
## '*': 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.04 -0.07 Inf 0.86
## ---
## '*': 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.08 0.06 -0.01 Inf 13.29
## ---
## '*': 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.07 0.03 0.01 Inf 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.09 0.05 0.01 Inf 28.2 *
## ---
## '*': 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.06 -0.08 Inf 1.31
## ---
## '*': 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.95
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 0.03 0.04 -0.04 Inf 3.62
## ---
## '*': 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.02 0.04 -0.09 Inf 0.5
## ---
## '*': 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.06 0.04 0 Inf 19.83 *
## ---
## '*': 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.06
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)
fit1 <- brm(bf(logC1~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a+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.406 seconds (Warm-up)
## 1.891 seconds (Sampling)
## 4.297 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.532 seconds (Warm-up)
## 2.953 seconds (Sampling)
## 5.485 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.766 seconds (Warm-up)
## 3.004 seconds (Sampling)
## 5.77 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.655 seconds (Warm-up)
## 2.268 seconds (Sampling)
## 4.923 seconds (Total)
summary(fit1)
## Family: asym_laplace (identity)
## Formula: logC1 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a + 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.72 0.07 4.58 4.86 2644 1
## age_groupgr3039 -0.03 0.07 -0.17 0.11 1673 1
## age_groupgr4049 -0.13 0.07 -0.28 0.01 1157 1
## age_groupgr5059 -0.09 0.07 -0.23 0.03 1359 1
## age_group60plus -0.08 0.08 -0.24 0.08 1134 1
## educ22 0.00 0.05 -0.10 0.09 2085 1
## educ23 0.09 0.06 -0.04 0.21 1730 1
## d1amarried 0.02 0.06 -0.10 0.14 1300 1
## h11 0.06 0.04 -0.01 0.14 2861 1
## selfhealthgood 0.05 0.04 -0.02 0.12 2905 1
## smosttmedium 0.07 0.05 -0.02 0.16 2388 1
## smosttheavy 0.05 0.05 -0.05 0.15 2485 1
## b18abad 0.02 0.03 -0.05 0.09 2855 1
## b6ayes 0.07 0.05 -0.02 0.16 3048 1
## label11 -0.02 0.05 -0.12 0.09 2308 1
## freeEn1 -0.11 0.04 -0.19 -0.03 3188 1
## ant1 0.04 0.04 -0.04 0.11 2424 1
## c7ad1 -0.07 0.03 -0.14 0.00 3163 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 3113 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_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 -0.03 0.07 -0.15 Inf 0.49
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 -0.13 0.07 -0.25 Inf 0.03
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 -0.09 0.07 -0.2 Inf 0.08
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -0.08 0.08 -0.22 Inf 0.17
## ---
## '*': 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.02 0.06 -0.07 Inf 1.93
## ---
## '*': 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.06 0.04 0 Inf 23.39 *
## ---
## '*': 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.95
## ---
## '*': 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.02 Inf 9.9
## ---
## '*': 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 13.04
## ---
## '*': 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.49
## ---
## '*': 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.14
## ---
## '*': 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.02 0.03 -0.04 Inf 2.13
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 0.07 0.05 -0.01 Inf 12.99
## ---
## '*': 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.02 0.05 -0.1 Inf 0.6
## ---
## '*': 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.17 Inf 0
## ---
## '*': 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.04 0.04 -0.03 Inf 5.05
## ---
## '*': 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.02
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)
fit1 <- brm(bf(logC1~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a+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: 2.782 seconds (Warm-up)
## 3.484 seconds (Sampling)
## 6.266 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.703 seconds (Warm-up)
## 2.704 seconds (Sampling)
## 5.407 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.866 seconds (Warm-up)
## 2.475 seconds (Sampling)
## 5.341 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.812 seconds (Warm-up)
## 2.471 seconds (Sampling)
## 5.283 seconds (Total)
summary(fit1)
## Family: asym_laplace (identity)
## Formula: logC1 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a + 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.95 0.08 4.79 5.10 1960 1
## age_groupgr3039 -0.03 0.08 -0.19 0.14 1937 1
## age_groupgr4049 -0.20 0.08 -0.34 -0.04 1413 1
## age_groupgr5059 -0.11 0.07 -0.25 0.04 1315 1
## age_group60plus -0.14 0.09 -0.31 0.05 1501 1
## educ22 -0.04 0.05 -0.12 0.06 1898 1
## educ23 0.03 0.06 -0.09 0.16 1622 1
## d1amarried 0.01 0.06 -0.11 0.11 1595 1
## h11 0.06 0.04 -0.02 0.14 2755 1
## selfhealthgood 0.04 0.04 -0.03 0.11 2865 1
## smosttmedium 0.02 0.05 -0.07 0.11 2275 1
## smosttheavy 0.10 0.05 -0.01 0.20 2489 1
## b18abad 0.03 0.04 -0.05 0.10 2272 1
## b6ayes 0.10 0.04 0.01 0.18 2716 1
## label11 0.06 0.05 -0.05 0.16 2356 1
## freeEn1 -0.07 0.05 -0.16 0.02 2451 1
## ant1 -0.01 0.04 -0.08 0.08 2665 1
## c7ad1 -0.10 0.05 -0.19 -0.01 2388 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 0.07 0.01 0.06 0.09 3191 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_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 -0.03 0.08 -0.16 Inf 0.57
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 -0.2 0.08 -0.32 Inf 0.01
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 -0.11 0.07 -0.23 Inf 0.06
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -0.14 0.09 -0.28 Inf 0.07
## ---
## '*': 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.09 Inf 1.29
## ---
## '*': 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.06 0.04 0 Inf 15.74
## ---
## '*': 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.04 0.05 -0.11 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.03 0.06 -0.07 Inf 2.11
## ---
## '*': 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.12
## ---
## '*': 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.02 0.05 -0.05 Inf 2.16
## ---
## '*': 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.1 0.05 0.01 Inf 26.03 *
## ---
## '*': 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 2.96
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 0.1 0.04 0.02 Inf 65.67 *
## ---
## '*': 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.06 0.05 -0.03 Inf 6.26
## ---
## '*': 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.07 0.05 -0.15 Inf 0.08
## ---
## '*': 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.07 Inf 0.79
## ---
## '*': 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.05 -0.17 Inf 0.02
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit1)
WAIC(fit, fit10, fit100)
fit2 <- brm(bf(logC1~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a*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: 3.797 seconds (Warm-up)
## 3.219 seconds (Sampling)
## 7.016 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.985 seconds (Warm-up)
## 3.109 seconds (Sampling)
## 7.094 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.734 seconds (Warm-up)
## 3.242 seconds (Sampling)
## 6.976 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.994 seconds (Warm-up)
## 3.329 seconds (Sampling)
## 7.323 seconds (Total)
summary(fit2)
## Family: asym_laplace (identity)
## Formula: logC1 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a * 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.58 0.08 4.42 4.74 1487 1
## age_groupgr3039 -0.14 0.08 -0.30 0.02 1927 1
## age_groupgr4049 -0.17 0.07 -0.30 -0.03 1452 1
## age_groupgr5059 -0.15 0.07 -0.28 -0.02 1289 1
## age_group60plus -0.06 0.07 -0.20 0.08 1453 1
## educ22 0.00 0.04 -0.09 0.08 1997 1
## educ23 0.05 0.06 -0.07 0.16 1669 1
## d1amarried 0.07 0.06 -0.05 0.19 1325 1
## h11 0.05 0.04 -0.02 0.12 2679 1
## selfhealthgood 0.06 0.04 -0.01 0.14 2997 1
## smosttmedium 0.08 0.05 -0.01 0.18 1722 1
## smosttheavy 0.02 0.05 -0.09 0.12 1925 1
## b18abad -0.03 0.03 -0.10 0.04 2995 1
## b6ayes 0.19 0.10 -0.01 0.39 1148 1
## p1 0.01 0.05 -0.10 0.11 1182 1
## p2 0.00 0.05 -0.11 0.10 1456 1
## b6ayes:p1 -0.14 0.12 -0.39 0.10 1209 1
## b6ayes:p2 -0.23 0.12 -0.46 0.01 1200 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 3618 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(fit2,"age_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 -0.14 0.08 -0.27 Inf 0.05
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 -0.17 0.07 -0.28 Inf 0.01
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 -0.15 0.07 -0.26 Inf 0.01
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -0.06 0.07 -0.18 Inf 0.23
## ---
## '*': 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.07 0.06 -0.04 Inf 6.19
## ---
## '*': 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.05 0.04 -0.01 Inf 12.42
## ---
## '*': 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 0.04 -0.07 Inf 0.93
## ---
## '*': 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.05 0.06 -0.05 Inf 4.14
## ---
## '*': 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.06 0.04 0 Inf 21.47 *
## ---
## '*': 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 Inf 22.12 *
## ---
## '*': 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.02 0.05 -0.07 Inf 1.67
## ---
## '*': 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.03 0.03 -0.09 Inf 0.22
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 0.19 0.1 0.02 Inf 30.75 *
## ---
## '*': 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.01 0.05 -0.09 Inf 1.27
## ---
## '*': 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.09 Inf 1.07
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p1) > 0 -0.14 0.12 -0.35 Inf 0.15
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p2) > 0 -0.23 0.12 -0.42 Inf 0.03
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)
fit2 <- brm(bf(logC1~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a*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.281 seconds (Warm-up)
## 3.657 seconds (Sampling)
## 6.938 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.624 seconds (Warm-up)
## 3.656 seconds (Sampling)
## 7.28 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.228 seconds (Warm-up)
## 2.928 seconds (Sampling)
## 6.156 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.279 seconds (Warm-up)
## 3.219 seconds (Sampling)
## 6.498 seconds (Total)
summary(fit2)
## Family: asym_laplace (identity)
## Formula: logC1 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a * 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.62 4.93 1673 1
## age_groupgr3039 -0.02 0.08 -0.18 0.13 1927 1
## age_groupgr4049 -0.16 0.07 -0.30 -0.01 1296 1
## age_groupgr5059 -0.09 0.07 -0.22 0.04 1404 1
## age_group60plus -0.08 0.08 -0.23 0.07 1459 1
## educ22 -0.02 0.05 -0.11 0.08 2057 1
## educ23 0.07 0.06 -0.06 0.20 1528 1
## d1amarried 0.05 0.06 -0.06 0.16 1455 1
## h11 0.05 0.04 -0.02 0.12 2919 1
## selfhealthgood 0.05 0.04 -0.02 0.12 2764 1
## smosttmedium 0.08 0.04 -0.01 0.16 2175 1
## smosttheavy 0.06 0.05 -0.04 0.15 2345 1
## b18abad -0.02 0.04 -0.09 0.05 2858 1
## b6ayes 0.16 0.11 -0.05 0.36 1573 1
## p1 -0.08 0.05 -0.18 0.02 2244 1
## p2 -0.10 0.05 -0.19 0.00 2024 1
## b6ayes:p1 -0.09 0.13 -0.35 0.16 1724 1
## b6ayes:p2 -0.12 0.13 -0.36 0.12 1593 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 3596 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(fit2,"age_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 -0.02 0.08 -0.16 Inf 0.72
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 -0.16 0.07 -0.28 Inf 0.02
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 -0.09 0.07 -0.21 Inf 0.1
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -0.08 0.08 -0.21 Inf 0.19
## ---
## '*': 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.05 0.04 -0.01 Inf 13.23
## ---
## '*': 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.09 Inf 0.57
## ---
## '*': 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.07 0.06 -0.04 Inf 5.85
## ---
## '*': 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 10.24
## ---
## '*': 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.04 0 Inf 19.62 *
## ---
## '*': 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.05 -0.02 Inf 8.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.02 0.04 -0.08 Inf 0.41
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 0.16 0.11 -0.02 Inf 12.75
## ---
## '*': 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.08 0.05 -0.17 Inf 0.06
## ---
## '*': 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.1 0.05 -0.17 Inf 0.02
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p1) > 0 -0.09 0.13 -0.31 Inf 0.33
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p2) > 0 -0.12 0.13 -0.32 Inf 0.22
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)
fit2 <- brm(bf(logC1~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a*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.921 seconds (Warm-up)
## 2.72 seconds (Sampling)
## 6.641 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.562 seconds (Warm-up)
## 2.641 seconds (Sampling)
## 6.203 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.625 seconds (Warm-up)
## 3.672 seconds (Sampling)
## 7.297 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.671 seconds (Warm-up)
## 3.957 seconds (Sampling)
## 7.628 seconds (Total)
summary(fit2)
## Family: asym_laplace (identity)
## Formula: logC1 ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a * 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.99 0.09 4.82 5.18 1747 1
## age_groupgr3039 -0.06 0.08 -0.20 0.11 1813 1
## age_groupgr4049 -0.24 0.07 -0.37 -0.10 1577 1
## age_groupgr5059 -0.14 0.07 -0.27 -0.01 1558 1
## age_group60plus -0.13 0.08 -0.29 0.04 1736 1
## educ22 -0.06 0.05 -0.15 0.03 1930 1
## educ23 0.02 0.06 -0.11 0.15 1762 1
## d1amarried 0.03 0.05 -0.08 0.13 1750 1
## h11 0.06 0.04 -0.02 0.14 2837 1
## selfhealthgood 0.03 0.03 -0.04 0.10 2573 1
## smosttmedium -0.01 0.04 -0.09 0.07 2438 1
## smosttheavy 0.06 0.05 -0.05 0.17 2303 1
## b18abad 0.01 0.04 -0.06 0.08 2810 1
## b6ayes 0.22 0.11 0.01 0.44 1476 1
## p1 -0.02 0.05 -0.13 0.08 1824 1
## p2 -0.06 0.05 -0.17 0.03 2016 1
## b6ayes:p1 -0.18 0.14 -0.45 0.09 1608 1
## b6ayes:p2 -0.15 0.12 -0.40 0.09 1533 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 0.07 0.01 0.06 0.09 3748 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(fit2,"age_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 -0.06 0.08 -0.18 Inf 0.28
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 -0.24 0.07 -0.35 Inf 0
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 -0.14 0.07 -0.25 Inf 0.02
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -0.13 0.08 -0.26 Inf 0.07
## ---
## '*': 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.03 0.05 -0.06 Inf 2.28
## ---
## '*': 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 12.29
## ---
## '*': 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.06 0.05 -0.13 Inf 0.13
## ---
## '*': 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.02 0.06 -0.08 Inf 1.68
## ---
## '*': 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.03 0.03 -0.02 Inf 4.38
## ---
## '*': 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.04 -0.08 Inf 0.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.06 0.05 -0.03 Inf 6.55
## ---
## '*': 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.05 Inf 1.53
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 0.22 0.11 0.04 Inf 52.33 *
## ---
## '*': 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.05 -0.11 Inf 0.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.06 0.05 -0.15 Inf 0.11
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p1) > 0 -0.18 0.14 -0.41 Inf 0.1
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b6ayes:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p2) > 0 -0.15 0.12 -0.36 Inf 0.12
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit2)
#Model 2: model for persistence
prior=get_prior(formula=highper~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a+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_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a+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.656 seconds (Warm-up)
## 0.625 seconds (Sampling)
## 1.281 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.656 seconds (Warm-up)
## 0.625 seconds (Sampling)
## 1.281 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.656 seconds (Warm-up)
## 0.641 seconds (Sampling)
## 1.297 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.656 seconds (Warm-up)
## 0.616 seconds (Sampling)
## 1.272 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.662 seconds (Warm-up)
## 0.688 seconds (Sampling)
## 1.35 seconds (Total)
summary(fit3)
## Family: bernoulli (logit)
## Formula: highper ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a + 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.25 0.74 -2.73 0.17 4201 1
## age_groupgr3039 -0.14 0.80 -1.66 1.41 3793 1
## age_groupgr4049 -1.48 0.78 -3.07 0.01 3110 1
## age_groupgr5059 -0.90 0.67 -2.25 0.42 2859 1
## age_group60plus -0.88 0.82 -2.55 0.72 2919 1
## educ22 0.09 0.46 -0.80 0.96 4150 1
## educ23 1.10 0.64 -0.14 2.36 3693 1
## d1amarried 0.32 0.60 -0.83 1.52 2886 1
## h11 0.78 0.37 0.06 1.51 5000 1
## selfhealthgood 0.52 0.36 -0.18 1.24 5000 1
## smosttmedium 0.46 0.50 -0.52 1.45 4335 1
## smosttheavy 0.63 0.51 -0.36 1.65 4372 1
## b18abad 0.29 0.40 -0.47 1.07 5000 1
## b6ayes 0.89 0.46 -0.02 1.80 5000 1
## label11 -0.17 0.49 -1.12 0.80 5000 1
## freeEn1 -1.16 0.43 -2.03 -0.30 5000 1
## ant1 0.26 0.41 -0.52 1.07 5000 1
## c7ad1 -0.39 0.37 -1.13 0.32 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(fit3,"age_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 -0.14 0.8 -1.43 Inf 0.76
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 -1.48 0.78 -2.8 Inf 0.03
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 -0.9 0.67 -2.04 Inf 0.09
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -0.88 0.82 -2.24 Inf 0.16
## ---
## '*': 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.32 0.6 -0.64 Inf 2.33
## ---
## '*': 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.78 0.37 0.17 Inf 57.14 *
## ---
## '*': 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.09 0.46 -0.65 Inf 1.39
## ---
## '*': 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.1 0.64 0.06 Inf 23.15 *
## ---
## '*': 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.52 0.36 -0.06 Inf 13.37
## ---
## '*': 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.46 0.5 -0.36 Inf 4.75
## ---
## '*': 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.63 0.51 -0.2 Inf 8.19
## ---
## '*': 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.29 0.4 -0.35 Inf 3.16
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit3,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 0.89 0.46 0.15 Inf 34.97 *
## ---
## '*': 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.17 0.49 -0.98 Inf 0.56
## ---
## '*': 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.16 0.43 -1.87 Inf 0
## ---
## '*': 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.26 0.41 -0.39 Inf 2.77
## ---
## '*': 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.39 0.37 -1.01 Inf 0.17
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit3)
prior=get_prior(formula=highper~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a*p, family="bernoulli", data=data2)
## Warning: Rows containing NAs were excluded from the model
set.seed(1234)
fit4=brm(formula=highper~age_group+educ2+d1a+h1+selfhealth+smostt
+b18a+b6a*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.884 seconds (Warm-up)
## 0.766 seconds (Sampling)
## 1.65 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.953 seconds (Warm-up)
## 0.907 seconds (Sampling)
## 1.86 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.906 seconds (Warm-up)
## 0.906 seconds (Sampling)
## 1.812 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.906 seconds (Warm-up)
## 0.938 seconds (Sampling)
## 1.844 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)
## 0.829 seconds (Sampling)
## 1.751 seconds (Total)
summary(fit4)
## Family: bernoulli (logit)
## Formula: highper ~ age_group + educ2 + d1a + h1 + selfhealth + smostt + b18a + b6a * 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.73 0.80 -2.29 0.84 5000 1
## age_groupgr3039 0.06 0.78 -1.45 1.63 3349 1
## age_groupgr4049 -1.56 0.78 -3.17 -0.08 3006 1
## age_groupgr5059 -0.83 0.70 -2.23 0.51 2686 1
## age_group60plus -0.78 0.83 -2.45 0.84 2982 1
## educ22 0.02 0.47 -0.89 0.93 5000 1
## educ23 0.79 0.63 -0.41 2.06 4622 1
## d1amarried 0.39 0.60 -0.75 1.58 3138 1
## h11 0.80 0.37 0.06 1.53 5000 1
## selfhealthgood 0.52 0.37 -0.20 1.24 5000 1
## smosttmedium 0.52 0.52 -0.49 1.58 5000 1
## smosttheavy 0.69 0.53 -0.33 1.74 5000 1
## b18abad 0.10 0.38 -0.62 0.84 5000 1
## b6ayes 0.82 1.08 -1.21 3.03 2777 1
## p1 -1.21 0.54 -2.31 -0.17 5000 1
## p2 -0.86 0.50 -1.87 0.12 5000 1
## b6ayes:p1 0.93 1.38 -1.85 3.66 3837 1
## b6ayes:p2 -0.55 1.26 -3.16 1.88 3484 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(fit4,"age_groupgr3039>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr3039) > 0 0.06 0.78 -1.21 Inf 1.14
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"age_groupgr4049 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr4049) > 0 -1.56 0.78 -2.87 Inf 0.02
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"age_groupgr5059 >0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_groupgr5059) > 0 -0.83 0.7 -1.99 Inf 0.13
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"age_group60plus>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (age_group60plus) > 0 -0.78 0.83 -2.16 Inf 0.22
## ---
## '*': 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.39 0.6 -0.57 Inf 2.81
## ---
## '*': 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.8 0.37 0.2 Inf 58.52 *
## ---
## '*': 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.02 0.47 -0.76 Inf 1.07
## ---
## '*': 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.79 0.63 -0.23 Inf 8.54
## ---
## '*': 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.52 0.37 -0.08 Inf 12.12
## ---
## '*': 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.52 0.52 -0.3 Inf 5.22
## ---
## '*': 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.69 0.53 -0.17 Inf 9.59
## ---
## '*': 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.1 0.38 -0.51 Inf 1.52
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6ayes>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes) > 0 0.82 1.08 -0.89 Inf 3.65
## ---
## '*': 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.21 0.54 -2.14 Inf 0.01
## ---
## '*': 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.86 0.5 -1.7 Inf 0.04
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6ayes:p1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p1) > 0 0.93 1.38 -1.34 Inf 2.97
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit4,"b6ayes:p2>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b6ayes:p2) > 0 -0.55 1.26 -2.65 Inf 0.5
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
plot(fit4)