Description Usage Arguments Details Value Author(s) Examples
plot(gbp.object)
draws shrinkage and posterior interval plots
1 2 |
x |
a resultant object of |
sort |
|
... |
further arguments passed to other methods. |
As for the argument x
, if the result of gbp
is designated to
b
like
"b <- gbp(z, n, model = "binomial")
", the argument x
is supposed to be b
.
This function produces two plots containing information about the prior, sample, and posterior means.
The first plot is a shrinkage plot representing sample means (black circle) on the upper horizontal line and prior (blue line) and posterior means (red circle) on the lower horizontal line. The aim of this plot is to get a sense of the magnitude of the shrinkage and to observe if any change in ordering of the groups has occurred. Crossovers (changes of order) are noted by a black square as indicated in the legend. If the points plotted have the same value then a sunflower plot is produced where each petal (line protruding from the point) represent the count of points with that value. The plot also aims to incorporate the uncertainty and the lengths of the violet and green lines are proportional to the standard error and the posterior standard deviation respectively.
The final plot shows interval estimates of all the groups (units) in a dataset. Two short horizontal ticks at both ends of each black vertical line indicate 97.5% and 2.5% quantiles of a posterior distribution for each group (Normal for Gaussian, Beta for Binomial, and Gamma for Poisson). Red dots (posterior mean) are between black circles (sample mean) and blue line(s) (prior mean) as a result of shrinkage (regression toward the mean).
If we want to see the interval plot (the second plot) NOT sorted by the order of se
for Gaussian, or of n
for Binomial and Poisson data, plot(b, sort = FALSE)
will show this plot by the order of data input.
Two plots described in details will be displayed.
Hyungsuk Tak, Joseph Kelly, and Carl Morris
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 28 29 30 31 32 33 34 35 | data(hospital)
z <- hospital$d
n <- hospital$n
y <- hospital$y
se <- hospital$se
###################################################################################
# We do not have any covariates and do not know a mean of the prior distribution. #
###################################################################################
###############################################################
# Gaussian Regression Interactive Multilevel Modeling (GRIMM) #
###############################################################
g <- gbp(y, se, model = "gaussian")
plot(g)
plot(g, sort = FALSE)
###############################################################
# Binomial Regression Interactive Multilevel Modeling (BRIMM) #
###############################################################
b <- gbp(z, n, model = "binomial")
plot(b)
plot(b, sort = FALSE)
##############################################################
# Poisson Regression Interactive Multilevel Modeling (PRIMM) #
##############################################################
p <- gbp(z, n, mean.PriorDist = 0.03, model = "poisson")
plot(p)
plot(p, sort = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.