If HPDinterval=TRUE, return the credibility interval for fixed effects model.
By default is FALSE. See package coda
prob
A numeric scalar in the interval (0,1) giving the target probability content of the intervals.
The nominal probability content of the intervals is the multiple of 1/nrow(obj) nearest to prob
Examples
# Not run
data(sensory)
Consumer <- factor(sensory$consumer)
Sacarose <- factor(sensory$sacarose)
#### Model
# Not run
dex1 <- Bayesthresh(cor ~ (1|Consumer) + Sacarose, burn = 0, Write=TRUE,
jump = 1, ef.iter = 10, data=sensory)
random.effects(dex1)
random.effects(dex1, HPDinterval=TRUE)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Bayesthresh)
Loading required package: lme4
Loading required package: Matrix
Loading required package: MASS
Loading required package: VGAM
Loading required package: stats4
Loading required package: splines
Loading required package: mvtnorm
Loading required package: matrixcalc
Loading required package: coda
Attaching package: 'coda'
The following object is masked from 'package:VGAM':
nvar
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Bayesthresh/random.effects.Rd_%03d_medium.png", width=480, height=480)
> ### Name: random.effects
> ### Title: Extract the random effects of the model
> ### Aliases: random.effects
> ### Keywords: models methods
>
> ### ** Examples
>
> # Not run
> data(sensory)
>
> Consumer <- factor(sensory$consumer)
> Sacarose <- factor(sensory$sacarose)
>
> #### Model
> # Not run
> dex1 <- Bayesthresh(cor ~ (1|Consumer) + Sacarose, burn = 0, Write=TRUE,
+ jump = 1, ef.iter = 10, data=sensory)
> random.effects(dex1)
Post.mean Post.std.dev
1 -0.701406904 0.4132468
2 -0.223510524 0.5040387
3 -0.259544968 0.3723681
4 -0.470951269 0.2008874
5 -0.307842059 0.2866817
6 0.329545497 0.3925750
7 0.091043727 0.4186300
8 0.504957047 0.3342081
9 -0.019139889 0.4228703
10 -0.432714796 0.2175027
11 0.059136096 0.2395917
12 -0.171171975 0.3036414
13 0.275264705 0.3771704
14 -0.415530875 0.3258325
15 0.764809142 0.7512223
16 -0.125921306 0.6020765
17 -0.120276831 0.3132886
18 0.065395596 0.3292687
19 -0.247560253 0.3030513
20 0.467089005 0.4657008
21 -0.465016387 0.4111471
22 -0.382904217 0.5674589
23 0.138794740 0.6179115
24 -0.392348840 0.1564484
25 0.009319144 0.3569850
26 -0.136943408 0.3698873
27 0.130192906 0.5644311
28 -0.155543374 0.3444830
29 -0.334838486 0.4075184
30 0.123397447 0.6309928
31 -0.435426902 0.5894318
32 -0.211577277 0.2905275
33 0.018749338 0.2627538
34 -0.294407324 0.3723595
35 -0.499326516 0.2433211
36 -0.163015381 0.3817794
> random.effects(dex1, HPDinterval=TRUE)
Post.mean Post.std.dev lower upper
1 -0.701406904 0.4132468 -1.25678967 0.038759583
2 -0.223510524 0.5040387 -1.30646548 0.396946271
3 -0.259544968 0.3723681 -0.85597677 0.489406544
4 -0.470951269 0.2008874 -0.83224578 -0.212976903
5 -0.307842059 0.2866817 -0.85912167 0.163173054
6 0.329545497 0.3925750 -0.65657613 0.802747772
7 0.091043727 0.4186300 -0.82027459 0.816012684
8 0.504957047 0.3342081 -0.05060113 1.001850640
9 -0.019139889 0.4228703 -0.92967943 0.370987048
10 -0.432714796 0.2175027 -0.72721278 -0.002259767
11 0.059136096 0.2395917 -0.29780281 0.449078387
12 -0.171171975 0.3036414 -0.59566788 0.267313557
13 0.275264705 0.3771704 -0.45817342 0.833768506
14 -0.415530875 0.3258325 -1.04639342 0.258916206
15 0.764809142 0.7512223 -1.15458110 1.736524640
16 -0.125921306 0.6020765 -1.61342320 0.590904520
17 -0.120276831 0.3132886 -0.55250856 0.613953595
18 0.065395596 0.3292687 -0.32533771 0.625952442
19 -0.247560253 0.3030513 -0.87443609 0.148862173
20 0.467089005 0.4657008 -0.67830983 1.045588339
21 -0.465016387 0.4111471 -1.14602891 -0.006719611
22 -0.382904217 0.5674589 -1.69515024 0.338987721
23 0.138794740 0.6179115 -1.36497365 1.059486027
24 -0.392348840 0.1564484 -0.60387024 -0.133001888
25 0.009319144 0.3569850 -0.57338698 0.461765104
26 -0.136943408 0.3698873 -0.91536940 0.338950206
27 0.130192906 0.5644311 -1.29532583 0.664490302
28 -0.155543374 0.3444830 -0.91131338 0.314432365
29 -0.334838486 0.4075184 -1.36343021 0.106020234
30 0.123397447 0.6309928 -1.38312643 1.072064414
31 -0.435426902 0.5894318 -2.04727453 0.039819990
32 -0.211577277 0.2905275 -0.74279319 0.214922199
33 0.018749338 0.2627538 -0.66924678 0.340574901
34 -0.294407324 0.3723595 -1.00509778 0.418410640
35 -0.499326516 0.2433211 -0.99169084 -0.073079707
36 -0.163015381 0.3817794 -0.68972509 0.588830619
>
>
>
>
>
> dev.off()
null device
1
>