bicreg                  package:BMA                  R Documentation

_B_a_y_e_s_i_a_n _M_o_d_e_l _A_v_e_r_a_g_i_n_g _f_o_r _l_i_n_e_a_r _r_e_g_r_e_s_s_i_o_n _m_o_d_e_l_s.

_D_e_s_c_r_i_p_t_i_o_n:

     Bayesian Model Averaging accounts for the model uncertainty
     inherent in the variable selection problem by averaging over the
     best models in the model class according to approximate posterior
     model probability.

_U_s_a_g_e:

     bicreg(x, y, wt = rep(1, length(y)), strict = FALSE, OR = 20, maxCol = 31, 
            drop.factor.levels = TRUE, nbest = 10)

_A_r_g_u_m_e_n_t_s:

       x: a matrix of independent variables 

       y: a vector of values for the dependent variable 

      wt: a vector of weights for regression 

  strict: logical. FALSE returns all models whose posterior model
          probability is within a factor of 1/OR of that of the best
          model. TRUE returns a more parsimonious set of models, where
          any model with a more likely submodel is eliminated.  

      OR: a number specifying the maximum ratio for excluding models in
          Occam's window 

  maxCol: a number specifying the maximum number of columns in the
          design matrix (including the intercept) to be kept. 

drop.factor.levels: logical. Indicates whether factor levels can be
          individually dropped in the stepwise procedure to reduce the
          number of columns in the design matrix, or if a factor can be
          dropped only in its entirety. 

   nbest: a value specifying the number of models of each size returned
          to bic.glm by the leaps algorithm.

_D_e_t_a_i_l_s:

     Bayesian Model Averaging accounts for the model uncertainty
     inherent in the variable selection problem by averaging over the
     best models in the model class according to the approximate
     posterior model probabilities.

_V_a_l_u_e:

     'bicreg' returns an object of class 'bicreg'

     The function 'summary' is used to print a summary of the results.
     The function 'plot' is used to plot posterior distributions for
     the coefficients.

     An object of class 'bicreg' is a list containing at least the
     following components:

postprob: the posterior probabilities of the models selected

  namesx: the names of the variables

   label: labels identifying the models selected

      r2: R2 values for the models

     bic: values of BIC for the models

    size: the number of independent variables in each of the models

   which: a logical matrix with one row per model and one column per
          variable indicating whether that variable is in the model

 probne0: the posterior probability that each variable is non-zero (in
          percent)

postmean: the posterior mean of each coefficient (from model averaging)

  postsd: the posterior standard deviation of each coefficient (from
          model averaging) 

condpostmean: the posterior mean of each coefficient conditional on the
          variable being included in the model

condpostsd: the posterior standard deviation of each coefficient
          conditional on the variable being included in the model

     ols: matrix with one row per model and one column per variable
          giving the OLS estimate of each coefficient for each model

      se: matrix with one row per model and one column per variable
          giving the standard error of each coefficient for each model

 reduced: a logical indicating whether any variables were dropped
          before model averaging

 dropped: a vector containing the names of those variables dropped
          before model averaging

    call: the matched call that created the bicreg object

_A_u_t_h_o_r(_s):

     Original Splus code developed by Adrian Raftery
     (raftery@AT@stat.washington.edu) and revised by Chris T. Volinsky.
     Translation to R by Ian Painter.

_R_e_f_e_r_e_n_c_e_s:

     Raftery, Adrian E. (1995). Bayesian model selection in social
     research (with Discussion). Sociological Methodology 1995 (Peter
     V. Marsden, ed.), pp. 111-196, Cambridge, Mass.: Blackwells.

     An earlier version, issued as Working Paper 94-12, Center for
     Studies in Demography and  Ecology, University of Washington
     (1994) is available as a  Postscript file at <URL:
     http://www.stat.washington.edu/tech.reports/bic.ps>

_S_e_e _A_l_s_o:

     'summary.bicreg', 'print.bicreg', 'plot.bicreg'

_E_x_a_m_p_l_e_s:

     library(MASS)
     data(UScrime)
     x<- UScrime[,-16]
     y<- log(UScrime[,16])
     x[,-2]<- log(x[,-2])
     lma<- bicreg(x, y, strict = FALSE, OR = 20) 
     summary(lma)
     plot(lma)

     imageplot.bma(lma)

