Summarizing BFI Fits
summary.bfi.RdSummary 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.estimationandbfifunctions.- A_hat
the component from
object. See theMAP.estimationandbfifunctions.- sd
the component from
object. Iffamily = "gaussian", the last element of this vector is the square root of the estimated dispersion. See theMAP.estimationandbfifunctions.- Lambda
the component from
object. See theMAP.estimationfunction.- formula
the component from
object. See theMAP.estimationfunction.- n
the component from
object. See theMAP.estimationfunction.- np
the component from
object. See theMAP.estimationfunction.- family
the component from
object. See theMAP.estimationfunction.- intercept
the component from
object. See theMAP.estimationfunction.- convergence
the component from
object. See theMAP.estimationfunction.- control
the component from
object. See theMAP.estimationfunction.- stratified
the component from
object. See thebfifunction.- 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
gaussianfamily withidentitylink function and thebinomialfamily withlogitlink function are used.- dispersion
the estimated variance of the random error, i.e.,
sigma2. Thedispersionis taken as1for thebinomialfamily.- 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)
class(fit)
#> [1] "bfi"
#-------------------------
# Summary of MAP estimates
#-------------------------
summary(fit)
#>
#> Summary of the local model:
#>
#> Formula: y ~ x1 + x2
#> Family: ‘gaussian’
#> Link: ‘identity’
#>
#> Coefficients:
#>
#> Estimate Std.Dev CI 2.5% CI 97.5%
#> (Intercept) 0.5077 0.3072 -0.0945 1.1099
#> x1 1.7133 0.1977 1.3259 2.1007
#> x22 3.9905 0.4676 3.0741 4.9070
#> x23 4.6274 0.4377 3.7695 5.4853
#>
#> Dispersion parameter (sigma2): 1.421
#> log Lik Posterior: -59.53
#> Convergence: 0
sumfit <- summary(fit, cur_mat = TRUE)
#>
#> Summary of the local model:
#>
#> Formula: y ~ x1 + x2
#> Family: ‘gaussian’
#> Link: ‘identity’
#>
#> Coefficients:
#>
#> Estimate Std.Dev CI 2.5% CI 97.5%
#> (Intercept) 0.5077 0.3072 -0.0945 1.1099
#> x1 1.7133 0.1977 1.3259 2.1007
#> x22 3.9905 0.4676 3.0741 4.9070
#> x23 4.6274 0.4377 3.7695 5.4853
#>
#> Dispersion parameter (sigma2): 1.421
#> log Lik Posterior: -59.53
#> Convergence: 0
#>
#> Minus the Curvature Matrix:
#>
#> (Intercept) x1 x22 x23 sigma2
#> (Intercept) 28.2460 6.0093 7.7402 9.8511 -0.1010
#> x1 6.0093 27.0031 0.8318 2.7736 -0.3427
#> x22 7.7402 0.8318 7.8402 0.0000 -0.7980
#> x23 9.8511 2.7736 0.0000 9.9511 -0.9253
#> sigma2 -0.1010 -0.3427 -0.7980 -0.9253 82.8423
sumfit$estimate
#> [1] 0.507736 1.713305 3.990528 4.627400
sumfit$logLikPost
#> [1] -59.53309
sumfit$dispersion
#> sigma2
#> 1.421159
sumfit$CI
#> 2.5 % 97.5 %
#> (Intercept) -0.09445457 1.109927
#> x1 1.32586120 2.100748
#> x22 3.07407378 4.906981
#> x23 3.76947073 5.485330
class(sumfit)
#> [1] "summary.bfi"