View source: R/summary.rglmb.R
| summary.rglmb | R Documentation |
These functions are all methods for class rglmb or summary.rglmb objects.
## S3 method for class 'rglmb'
summary(object, ...)
## S3 method for class 'summary.rglmb'
print(x, digits = max(3, getOption("digits") - 3), ...)
object |
an object of class |
x |
an object of class |
digits |
the number of significant digits to use when printing. |
... |
Additional optional arguments |
The summary.rglmb function summarizes the output from the
rglmb function. It takes an object of class rglmb as an input.
The output to a large extent mirrors the output from the summary.glm
function. This is particularly true for the print output from the function
(i.e. the output of the function print.summary.rglmb).
summary.rglmb returns a object of class "summary.rglmb", a
list with components:
n |
number of draws generated |
coefficients1 |
Matrix with the prior mean and approximate weight for the prior relative to the data |
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 |
rglmb; glmb, glmbayes-package,
rlmb, lmb, summary,
summary.lm, summary.glm.
data(menarche,package="MASS")
summary(menarche)
Age2=menarche$Age-13
x<-matrix(as.numeric(1.0),nrow=length(Age2),ncol=2)
x[,2]=Age2
y=menarche$Menarche/menarche$Total
wt=menarche$Total
mu<-matrix(as.numeric(0.0),nrow=2,ncol=1)
mu[2,1]=(log(0.9/0.1)-log(0.5/0.5))/3
V1<-1*diag(as.numeric(2.0))
# 2 standard deviations for prior estimate at age 13 between 0.1 and 0.9
## Specifies uncertainty around the point estimates
V1[1,1]<-((log(0.9/0.1)-log(0.5/0.5))/2)^2
V1[2,2]=(3*mu[2,1]/2)^2 # Allows slope to be up to 3 times as large as point estimate
out<-rglmb(n = 1000, y=y, x=x, pfamily=dNormal(mu=mu,Sigma=V1), weights = wt,
family = binomial(logit))
summary(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.