Description Usage Arguments Details Value Author(s) See Also Examples
This function computes the posterior probability of each
term using the MCMC output of "bcct"
and "bict"
objects.
1 | inter_probs(object, cutoff = 0.75, n.burnin = 0, thin = 1)
|
object |
An object of class |
cutoff |
An optional argument giving the cutoff posterior probability for displaying posterior
summary statistics of the log-linear parameters. Only those log-linear parameters with
a posterior probability greater than |
n.burnin |
An optional argument giving the number of iterations to use as burn-in. The default value is 0. |
thin |
An optional argument giving the amount of thinning to use, i.e. the computations are
based on every |
This function provides a scaled back version of what inter_stats
provides.
The use of thinning is recommended when the number of MCMC iterations and/or the number of log-linear parameters in the maximal model are/is large, which may cause problems with comuter memory storage.
This function returns an object of class "interprob"
which is a list with the
following components.
term |
A vector of term labels. |
prob |
A vector of posterior probabilities. |
thin |
The value of the argument |
The function will only return elements in the above list if prob
> cutoff
.
Antony M. Overstall A.M.Overstall@soton.ac.uk.
bcct
,
bict
,
print.interprob
,
inter_stats
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | set.seed(1)
## Set seed for reproducibility
data(AOH)
## Load AOH data
test1<-bcct(formula=y~(alc+hyp+obe)^3,data=AOH,n.sample=100,prior="UIP")
## Starting from maximal model of saturated model do 100 iterations of MCMC
## algorithm.
inter_probs(test1,n.burnin=10,cutoff=0)
## Calculate posterior probabilities having used a burn-in phase of
## 10 iterations and a cutoff of 0 (i.e. display all terms with
## non-zero posterior probability). Will get the following:
#Posterior probabilities of log-linear parameters:
# post_prob
#(Intercept) 1.0000
#alc 1.0000
#hyp 1.0000
#obe 1.0000
#alc:hyp 0.1778
#alc:obe 0.0000
#hyp:obe 0.4444
#alc:hyp:obe 0.0000
## Note that the MCMC chain (after burn-in) does not visit any models
## with the alc:obe or alc:hyp:obe interactions.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.