summary.glmb: Summarizing Bayesian Generalized Linear Model Fits

Description Usage Arguments Details Value See Also Examples

View source: R/summary.glmb.R

Description

These functions are all methods for class glmb or summary.glmb objects.

Usage

1
2
3
4
5
## S3 method for class 'glmb'
summary(object, ...)

## S3 method for class 'summary.glmb'
print(x, digits = max(3, getOption("digits") - 3), ...)

Arguments

object

an object of class "glmb" for which a summary is desired.

x

an object of class "summary.glmb" for which a printed output is desired.

digits

the number of significant digits to use when printing.

...

Additional optional arguments

Details

The summary.glmb function summarizes the output from the glmb function. Key output includes mean residuals, information related to the prior, mean coefficients with associated stats, percentiles for the coefficients, as well as the effective number of parameters and the DIC statistic.

Value

summary.glmb returns a object of class "summary.glmb", a list with components:

call

the component from object

n

number of draws generated

residuals

vector of mean deviance residuals

coefficients1

Matrix with the prior mean and maximum likelihood coefficients with associated standard deviations

coefficients

Matrix with columns for the posterior mode, posterior mean, posterior standard deviation, monte carlo error, and tail probabilities (posterior probability of observing a value for the coefficient as extreme as the prior mean)

Percentiles

Matrix with estimated percentiles associated with the posterior density

pD

Estimated effective number of parameters

deviance

Vector with draws for the deviance

DIC

Estimated DIC statistic

iters

Average number of candidates per generated draws

See Also

lmb, glmb, summary, [stats]summary.lm,[stats]summary.glm.

Examples

 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
36
37
38
39
40
41
###########################  Example for glmb function:
## Dobson (1990) Page 93: Randomized Controlled Trial :
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
print(d.AD <- data.frame(treatment, outcome, counts))

mysd<-1
mu<-matrix(0,5)
mu[1,1]=log(mean(counts))
V0<-((mysd)^2)*diag(5)
glmb.D93<-glmb(counts ~ outcome + treatment, family = poisson(),
pfamily=dNormal(mu=mu,Sigma=V0))
summary(glmb.D93)

###########################  Example for lmb function

## Annette Dobson (1990) "An Introduction to Generalized Linear Models".
## Page 9: Plant Weight Data.
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
weight <- c(ctl, trt)

ps=Prior_Setup(weight ~ group)
mu=ps$mu
V=ps$Sigma
mu[1,1]=mean(weight)

Prior_Check(weight ~ group,family =gaussian(),
            pfamily=dNormal(mu=mu,Sigma=V))

## May move this step inside the Prior_Check function
lm.D9 <- lm(weight ~ group,x=TRUE,y=TRUE)
disp_ML=sigma(lm.D9)^2
n_prior=2
shape=n_prior/2
rate= disp_ML*shape

lmb.D9=lmb(weight ~ group,dNormal_Gamma(mu,V/disp_ML,shape=shape,rate=rate))
summary(lmb.D9)

knygren/glmbayes documentation built on Sept. 4, 2020, 4:39 p.m.