bayesresiduals          package:LearnBayes          R Documentation

_C_o_m_p_u_t_a_t_i_o_n _o_f _p_o_s_t_e_r_i_o_r _r_e_s_i_d_u_a_l _o_u_t_l_y_i_n_g _p_r_o_b_a_b_i_l_i_t_i_e_s _f_o_r _a _l_i_n_e_a_r _r_e_g_r_e_s_s_i_o_n _m_o_d_e_l

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

     Computes the posterior probabilities that Bayesian residuals
     exceed a cutoff value for a  linear regression model with a
     noninformative prior

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

     bayesresiduals(lmfit,post,k)

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

   lmfit: output of the regression function lm

    post: list with components beta, matrix of simulated draws of
          regression parameter, and  sigma, vector of simulated draws
          of sampling standard deviation

       k: cut-off value that defines an outlier

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

     vector of posterior outlying probabilities

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

     Jim Albert

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

     chirps=c(20,16.0,19.8,18.4,17.1,15.5,14.7,17.1,15.4,16.2,15,17.2,16,17,14.1)
     temp=c(88.6,71.6,93.3,84.3,80.6,75.2,69.7,82,69.4,83.3,78.6,82.6,80.6,83.5,76.3)
     X=cbind(1,chirps)
     lmfit=lm(temp~X)
     m=1000
     post=blinreg(temp,X,m)
     k=2
     bayesresiduals(lmfit,post,k)

