Skip to contents

Summary method for an object with class 'bfi' created by the MAP.estimation and bfi functions.

Usage

# S3 method for class 'bfi'
summary(object,
        cur_mat = FALSE,
        digits = max(3, getOption("digits") - 3),
        ...)

Arguments

object

fitted bfi object.

cur_mat

logical; if TRUE, minus the curvature matrix around the estimated parameters is returned and printed. Default is FALSE.

digits

significant digits in printout.

...

additional arguments affecting the summary produced.

Details

summary.bfi() gives information about the MAP estimates of parameters of the model. It can be used for the bfi objects built by the MAP.estimation and bfi functions.

The output of the summary method shows the details of the model, i.e. formula, family and link function used to specify the generalized linear model, followed by information about the estimates, standard deviations and credible intervals. Information about the log-likelihood posterior and convergence status are also provided.

By default, summary.bfi function does not return (minus) the curvature matrix, but the user can use cur_mat = TRUE to print it.

Value

summary.bfi returns an object of class summary.bfi, a list with the following components:

theta_hat

the component from object. The last element of this vector is the estimate of the dispersion parameter (sigma2) if family = "gaussian". See the MAP.estimation and bfi functions.

A_hat

the component from object. See the MAP.estimation and bfi functions.

sd

the component from object. If family = "gaussian", the last element of this vector is the square root of the estimated dispersion. See the MAP.estimation and bfi functions.

Lambda

the component from object. See the MAP.estimation function.

formula

the component from object. See the MAP.estimation function.

n

the component from object. See the MAP.estimation function.

np

the component from object. See the MAP.estimation function.

family

the component from object. See the MAP.estimation function.

intercept

the component from object. See the MAP.estimation function.

convergence

the component from object. See the MAP.estimation function.

control

the component from object. See the MAP.estimation function.

stratified

the component from object. See the bfi function.

estimate

the estimated regression coefficients, i.e., without the estimate sigma2.

logLikPost

the value of the log-likelihood posterior density evaluated at estimates (theta_hat).

link

the link function only for GLMs, not for the survival family. By default the gaussian family with identity link function and the binomial family with logit link function are used.

dispersion

the estimated variance of the random error, i.e., sigma2. The dispersion is taken as 1 for the binomial family.

CI

a 95% credible interval of the MAP estimates of the parameters.

Author

Hassan Pazira
Maintainer: Hassan Pazira hassan.pazira@radboudumc.nl

See also

Examples

#-------------
# y ~ Gaussian
#-------------
# model assumption:
theta <- c(1, 2, 3, 4, 1.5)  # coefficients and sigma2 = 1.5

#----------------
# Data Simulation
#----------------
n      <- 40
X      <- data.frame(x1=rnorm(n),                     # continuous variable
                     x2=sample(1:3, n, replace=TRUE)) # categorical variable
Xx2_1  <- ifelse(X$x2 == '2', 1, 0)
Xx2_2  <- ifelse(X$x2 == '3', 1, 0)
X$x2   <- as.factor(X$x2)
eta    <- theta[1] + theta[2] * X$x1 + theta[3] * Xx2_1 + theta[4] * Xx2_2
mu     <- gaussian()$linkinv(eta)
y      <- rnorm(n, mu, sd = sqrt(theta[5]))

#----------------
# MAP estimations
#----------------
Lambda <- inv.prior.cov(X, lambda = c(0.1, 0.5), family = "gaussian")
fit    <- MAP.estimation(y, X, family = "gaussian", Lambda)
#> Error in MAP.estimation(y, X, family = "gaussian", Lambda): The algorithm did not converge.
class(fit)
#> Error: object 'fit' not found

#-------------------------
# Summary of MAP estimates
#-------------------------
summary(fit)
#> Error: object 'fit' not found
sumfit <- summary(fit, cur_mat = TRUE)
#> Error: object 'fit' not found
sumfit$estimate
#> Error: object 'sumfit' not found
sumfit$logLikPost
#> Error: object 'sumfit' not found
sumfit$dispersion
#> Error: object 'sumfit' not found
sumfit$CI
#> Error: object 'sumfit' not found
class(sumfit)
#> Error: object 'sumfit' not found