fagan.plot           package:TeachingDemos           R Documentation

_C_r_e_a_t_e _a _F_a_g_a_n _p_l_o_t _t_o _d_e_m_o_n_s_t_r_a_t_e _B_a_y_e_s _T_h_e_o_r_e_m _a_n_d _s_c_r_e_e_n_i_n_g
_t_e_s_t_s

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

     These functions create a plot showing the relationship between the
     prior probability, the LR (combination of sensitivity and
     specificity), and the posterior probability.

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

     fagan.plot(probs.pre.test, LR, test.result="+")
     plotFagan()
     plotFagan2()

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

probs.pre.test: The prior probability 

      LR: the likelihood ratio (sensitivity/(1-specificity))

test.result: either '+' or '-' indicating whether you want the
          probability of the event or of not seeing the event

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

     When Bayes theorem is expressed in terms of log-odds it turns out
     that the posterior log-odds are a linear function of the prior
     log-odds and the log likelihood ratio.  These functions plot an
     axis on the left with the prior log-odds, an axis in the middle
     representing the log likelihood ratio and an axis on the right
     representing the posterior log-odds.  A line is then drawn from
     the prior probability on the left through the LR in the center and
     extended to the posterior probability on the right.  The
     'fagan.plot' creates the plot based on input to the function.  The
     'plotFagan' and 'plotFagan2' functions set up Tk windows with
     sliders representing the possible inputs and show how the plot and
     the posterior probability changes when you adjust the inputs.  The
     'plotFagan' function creates sliders for the prior probability and
     the LR, while the 'plotFagan2' function replaces the LR slider
     with 2 sliders for the sensitivity and specificity.

     More detail on the plots and the math behind them can be found at
     the websites below.

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

     These functions are run for their side effects and do not return a
     meaningful value

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

     Guazzetti Stefano and Greg Snow greg.snow@intermountainmail.org

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

     Fagan TJ. Nomogram for Bayes theorem. N Engl J Med
     1975;293(5):257-61.  <URL:
     http://www.cmh.edu/stats/definitions/fagan.htm> <URL:
     http://ebm.bmjjournals.com/cgi/content/full/6/6/164>

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

     'slider'

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

     ## Not run: 
      fagan.plot(0.8, 2)

      fagan.plot(0.8, 0.95/(1-0.90) )

      plotFagan()

      plotFagan2()
     ## End(Not run)

