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$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, 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
options(mc.cores = parallel::detectCores())
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
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.
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.08 0.04 -0.13 Inf 0.02
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"freeEn1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (freeEn1) > 0 -0.04 0.03 -0.1 Inf 0.12
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"ant1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (ant1) > 0 0.02 0.03 -0.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(logC1~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
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: 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.63 0.08 4.48 4.77 2285 1
## age_groupgr3039 0.08 0.04 -0.01 0.16 2285 1
## age_groupgr4049 0.00 0.05 -0.10 0.09 2040 1
## age_groupgr5059 0.02 0.07 -0.12 0.17 2094 1
## age_group60plus -0.02 0.13 -0.25 0.27 2706 1
## educ22 0.02 0.06 -0.09 0.13 1927 1
## educ23 0.13 0.06 0.00 0.25 1809 1
## d1amarried 0.01 0.04 -0.08 0.09 2317 1
## h11 0.01 0.03 -0.06 0.08 3049 1
## selfhealthgood 0.08 0.03 0.01 0.14 3188 1
## smosttmedium 0.00 0.04 -0.08 0.08 2337 1
## smosttheavy 0.07 0.04 -0.02 0.16 2517 1
## b18abad 0.06 0.04 -0.01 0.13 3072 1
## b6ayes 0.03 0.05 -0.07 0.13 3085 1
## label11 -0.09 0.05 -0.18 0.00 2524 1
## freeEn1 -0.06 0.04 -0.14 0.02 2743 1
## ant1 0.02 0.04 -0.06 0.10 2644 1
## c7ad1 0.06 0.04 -0.02 0.14 2854 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 0.1 0.01 0.09 0.11 2949 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.08 0.04 0.01 Inf 26.78 *
## ---
## '*': 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 0.05 -0.08 Inf 0.98
## ---
## '*': 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.02 0.07 -0.1 Inf 1.54
## ---
## '*': 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.02 0.13 -0.21 Inf 0.68
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (d1amarried) > 0 0.01 0.04 -0.06 Inf 1.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.01 0.03 -0.04 Inf 1.82
## ---
## '*': 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.02 0.06 -0.07 Inf 2.02
## ---
## '*': 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.06 0.02 Inf 36.04 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"selfhealthgood>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (selfhealthgood) > 0 0.08 0.03 0.02 Inf 89.91 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (smosttmedium) > 0 0 0.04 -0.07 Inf 1
## ---
## '*': 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.07 0.04 -0.01 Inf 14.69
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b18abad) > 0 0.06 0.04 0 Inf 16.94
## ---
## '*': 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.05 -0.05 Inf 2.91
## ---
## '*': 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.09 0.05 -0.17 Inf 0.03
## ---
## '*': 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.06 0.04 -0.12 Inf 0.07
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"ant1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (ant1) > 0 0.02 0.04 -0.04 Inf 2.53
## ---
## '*': 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.01 Inf 11.46
## ---
## '*': 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 = data1,
family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
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: 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.92 0.08 4.76 5.08 2646 1
## age_groupgr3039 0.04 0.05 -0.07 0.15 1726 1
## age_groupgr4049 0.00 0.06 -0.12 0.11 1909 1
## age_groupgr5059 0.03 0.08 -0.12 0.20 2105 1
## age_group60plus 0.11 0.16 -0.20 0.43 2506 1
## educ22 -0.06 0.06 -0.18 0.06 1819 1
## educ23 0.01 0.06 -0.11 0.12 1985 1
## d1amarried 0.00 0.05 -0.10 0.09 2033 1
## h11 0.02 0.04 -0.06 0.09 2427 1
## selfhealthgood 0.07 0.04 -0.01 0.14 2550 1
## smosttmedium -0.03 0.05 -0.14 0.07 2321 1
## smosttheavy 0.06 0.05 -0.05 0.16 2095 1
## b18abad 0.04 0.04 -0.04 0.12 2442 1
## b6ayes 0.00 0.05 -0.10 0.11 2380 1
## label11 -0.11 0.06 -0.22 0.01 2365 1
## freeEn1 0.05 0.04 -0.04 0.13 2216 1
## ant1 0.03 0.04 -0.05 0.11 2306 1
## c7ad1 0.09 0.04 0.01 0.16 2918 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 0.08 0.01 0.07 0.09 3482 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.04 0.05 -0.05 Inf 3.36
## ---
## '*': 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 0.06 -0.1 Inf 0.93
## ---
## '*': 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.08 -0.1 Inf 1.71
## ---
## '*': 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.11 0.16 -0.16 Inf 2.94
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (d1amarried) > 0 0 0.05 -0.09 Inf 0.94
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (h11) > 0 0.02 0.04 -0.04 Inf 2.32
## ---
## '*': 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.06 0.06 -0.16 Inf 0.2
## ---
## '*': 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.01 0.06 -0.09 Inf 1.18
## ---
## '*': 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.04 0 Inf 24.81 *
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"smosttmedium>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (smosttmedium) > 0 -0.03 0.05 -0.12 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 0.06 0.05 -0.04 Inf 5.61
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b18abad) > 0 0.04 0.04 -0.03 Inf 4.19
## ---
## '*': 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 0.05 -0.08 Inf 1.01
## ---
## '*': 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.11 0.06 -0.2 Inf 0.03
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"freeEn1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (freeEn1) > 0 0.05 0.04 -0.02 Inf 6.45
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit1,"ant1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (ant1) > 0 0.03 0.04 -0.04 Inf 2.96
## ---
## '*': 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.09 0.04 0.03 Inf 87.89 *
## ---
## '*': 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 = data1,
family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
summary(fit2)
## Family: asym_laplace (identity)
## Formula: logC1 ~ 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 4.47 0.05 4.36 4.58 2844 1
## age_groupgr3039 0.05 0.04 -0.02 0.12 2294 1
## age_groupgr4049 0.04 0.04 -0.04 0.12 1736 1
## age_groupgr5059 -0.04 0.05 -0.15 0.06 2575 1
## age_group60plus -0.14 0.12 -0.38 0.08 2619 1
## educ22 0.06 0.04 -0.02 0.13 2019 1
## educ23 0.13 0.04 0.05 0.22 1927 1
## d1amarried 0.00 0.04 -0.08 0.07 2512 1
## h11 0.00 0.03 -0.05 0.06 2744 1
## selfhealthgood 0.09 0.03 0.04 0.15 3325 1
## smosttmedium 0.04 0.04 -0.03 0.11 2360 1
## smosttheavy 0.05 0.04 -0.03 0.12 2251 1
## b18abad 0.08 0.03 0.02 0.13 2881 1
## b6ayes -0.01 0.12 -0.25 0.20 959 1
## p1 -0.02 0.03 -0.08 0.05 2032 1
## p2 -0.02 0.04 -0.10 0.05 1964 1
## b6ayes:p1 -0.05 0.14 -0.33 0.24 1136 1
## b6ayes:p2 0.03 0.13 -0.20 0.29 1047 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 0.07 0 0.06 0.08 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 0.05 0.04 -0.01 Inf 11.38
## ---
## '*': 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.04 0.04 -0.03 Inf 4.89
## ---
## '*': 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.04 0.05 -0.13 Inf 0.3
## ---
## '*': 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.14 0.12 -0.34 Inf 0.12
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"d1amarried>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (d1amarried) > 0 0 0.04 -0.07 Inf 0.83
## ---
## '*': 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 0.03 -0.04 Inf 1.21
## ---
## '*': 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.04 0 Inf 14.62
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (educ23) > 0 0.13 0.04 0.06 Inf 999 *
## ---
## '*': 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.09 0.03 0.05 Inf 1999 *
## ---
## '*': 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.04 0.04 -0.02 Inf 5.4
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (smosttheavy) > 0 0.05 0.04 -0.02 Inf 6.8
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b18abad) > 0 0.08 0.03 0.03 Inf 189.48 *
## ---
## '*': 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.01 0.12 -0.21 Inf 0.99
## ---
## '*': 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.03 -0.07 Inf 0.41
## ---
## '*': 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.02 0.04 -0.09 Inf 0.35
## ---
## '*': 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.05 0.14 -0.28 Inf 0.58
## ---
## '*': 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.03 0.13 -0.17 Inf 1.41
## ---
## '*': 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 = data1,
family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
summary(fit2)
## Family: asym_laplace (identity)
## Formula: logC1 ~ 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 4.65 0.08 4.50 4.80 2673 1
## age_groupgr3039 0.06 0.05 -0.03 0.15 2866 1
## age_groupgr4049 0.00 0.05 -0.10 0.10 2152 1
## age_groupgr5059 -0.01 0.07 -0.14 0.13 2331 1
## age_group60plus -0.05 0.14 -0.31 0.26 3410 1
## educ22 0.03 0.06 -0.08 0.14 2416 1
## educ23 0.11 0.07 -0.01 0.24 2303 1
## d1amarried -0.01 0.04 -0.10 0.07 2938 1
## h11 0.00 0.04 -0.07 0.07 3223 1
## selfhealthgood 0.06 0.03 -0.01 0.13 3466 1
## smosttmedium 0.01 0.04 -0.08 0.09 2965 1
## smosttheavy 0.07 0.05 -0.02 0.16 3182 1
## b18abad 0.05 0.04 -0.02 0.13 3037 1
## b6ayes 0.07 0.09 -0.13 0.24 1799 1
## p1 0.03 0.05 -0.06 0.13 2489 1
## p2 0.01 0.04 -0.07 0.09 2399 1
## b6ayes:p1 -0.10 0.13 -0.35 0.17 2231 1
## b6ayes:p2 -0.01 0.13 -0.26 0.26 1790 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 0.1 0.01 0.09 0.11 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 0.06 0.05 -0.01 Inf 9.84
## ---
## '*': 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 0.05 -0.09 Inf 0.84
## ---
## '*': 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.01 0.07 -0.12 Inf 0.7
## ---
## '*': 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.05 0.14 -0.27 Inf 0.49
## ---
## '*': 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.01 0.04 -0.08 Inf 0.64
## ---
## '*': 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 0.04 -0.06 Inf 0.96
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ22>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (educ22) > 0 0.03 0.06 -0.06 Inf 2.4
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"educ23>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (educ23) > 0 0.11 0.07 0.01 Inf 23.24 *
## ---
## '*': 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.03 0.01 Inf 25.49 *
## ---
## '*': 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.06 Inf 1.26
## ---
## '*': 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.07 0.05 -0.01 Inf 14.81
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b18abad) > 0 0.05 0.04 -0.01 Inf 11.23
## ---
## '*': 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.07 0.09 -0.09 Inf 3.55
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p1>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (p1) > 0 0.03 0.05 -0.05 Inf 2.85
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"p2>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (p2) > 0 0.01 0.04 -0.06 Inf 1.32
## ---
## '*': 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.1 0.13 -0.32 Inf 0.29
## ---
## '*': 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.01 0.13 -0.21 Inf 0.89
## ---
## '*': 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 = data1,
family = asym_laplace())
## Warning: Rows containing NAs were excluded from the model
## Compiling the C++ model
## Start sampling
summary(fit2)
## Family: asym_laplace (identity)
## Formula: logC1 ~ 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 4.88 0.09 4.71 5.06 1859 1
## age_groupgr3039 0.03 0.06 -0.09 0.15 1204 1
## age_groupgr4049 -0.01 0.06 -0.14 0.11 1210 1
## age_groupgr5059 0.02 0.09 -0.16 0.21 1648 1
## age_group60plus 0.12 0.18 -0.24 0.48 2609 1
## educ22 0.00 0.06 -0.12 0.11 1967 1
## educ23 0.05 0.06 -0.07 0.16 1974 1
## d1amarried 0.01 0.06 -0.10 0.11 1457 1
## h11 -0.01 0.04 -0.08 0.06 2364 1
## selfhealthgood 0.05 0.04 -0.02 0.13 2243 1
## smosttmedium -0.06 0.05 -0.16 0.05 2042 1
## smosttheavy 0.05 0.05 -0.05 0.16 1908 1
## b18abad 0.05 0.04 -0.03 0.13 2285 1
## b6ayes 0.00 0.10 -0.18 0.21 1467 1
## p1 0.12 0.05 0.02 0.22 1737 1
## p2 0.06 0.05 -0.04 0.15 1820 1
## b6ayes:p1 -0.04 0.15 -0.33 0.25 1688 1
## b6ayes:p2 0.11 0.12 -0.15 0.34 1428 1
##
## Family Specific Parameters:
## Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sigma 0.08 0.01 0.07 0.09 3653 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.03 0.06 -0.07 Inf 2.2
## ---
## '*': 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.01 0.06 -0.11 Inf 0.74
## ---
## '*': 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.02 0.09 -0.13 Inf 1.41
## ---
## '*': 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.12 0.18 -0.18 Inf 3.3
## ---
## '*': 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.01 0.06 -0.09 Inf 1.17
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"h11>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (h11) > 0 -0.01 0.04 -0.07 Inf 0.63
## ---
## '*': 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.06 -0.1 Inf 1.01
## ---
## '*': 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 3.5
## ---
## '*': 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.11
## ---
## '*': 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.06 0.05 -0.14 Inf 0.15
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"smosttheavy>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (smosttheavy) > 0 0.05 0.05 -0.03 Inf 5.24
## ---
## '*': The expected value under the hypothesis lies outside the 95% CI.
hypothesis(fit2,"b18abad>0",alpha=0.05)
## Hypothesis Tests for class b:
## Estimate Est.Error l-95% CI u-95% CI Evid.Ratio
## (b18abad) > 0 0.05 0.04 -0.02 Inf 7.47
## ---
## '*': 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 0.1 -0.15 Inf 0.82
## ---
## '*': 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.12 0.05 0.04 Inf 101.56 *
## ---
## '*': 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.02 Inf 7.46
## ---
## '*': 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.04 0.15 -0.27 Inf 0.66
## ---
## '*': 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.11 0.12 -0.1 Inf 4.73
## ---
## '*': 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
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
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
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
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
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
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
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
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
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
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)