Summarizing BFI Fits
summary.bfi.Rd
Summary method for an object with class 'bfi' created by the MAP.estimation
and bfi
functions.
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) iffamily = "gaussian"
. See theMAP.estimation
andbfi
functions.- A_hat
the component from
object
. See theMAP.estimation
andbfi
functions.- sd
the component from
object
. Iffamily = "gaussian"
, the last element of this vector is the square root of the estimated dispersion. See theMAP.estimation
andbfi
functions.- Lambda
the component from
object
. See theMAP.estimation
function.- formula
the component from
object
. See theMAP.estimation
function.- n
the component from
object
. See theMAP.estimation
function.- np
the component from
object
. See theMAP.estimation
function.- family
the component from
object
. See theMAP.estimation
function.- intercept
the component from
object
. See theMAP.estimation
function.- convergence
the component from
object
. See theMAP.estimation
function.- control
the component from
object
. See theMAP.estimation
function.- stratified
the component from
object
. See thebfi
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 withidentity
link function and thebinomial
family withlogit
link function are used.- dispersion
the estimated variance of the random error, i.e.,
sigma2
. Thedispersion
is taken as1
for thebinomial
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
MAP.estimation
and bfi
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