panel.errbars             package:memisc             R Documentation

_P_a_n_e_l _F_u_n_c_t_i_o_n_s _f_o_r _E_r_r_o_r _B_a_r_s

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

     'panel.errbars' plots points are draws a line suppelemented with
     error bars.

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

     panel.errbars(x,y,...,panel.xy=panel.xyplot,
                     make.grid=c("horizontal","vertical","both","none"),ewidth=0)

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

     x,y: numeric values, the points around which error bars are
          plotted. 'x' is a numeric vector, 'y' is a matrix with three
          columns, the values, the lower and the upper ends of the
          error bars. 

     ...: graphical parameters passed to 'panel.xy'

panel.xy: panel function to produce the plot to which error bars are
          added

make.grid: character string, determines the direction of grid lines
          added to the plot

  ewidth: numerical value, width of the whiskers of the error bars

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

     'panel.xyplot'

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

     library(lattice)
     library(grid)


     applications <- aggregate(percent(Dept,weight=Freq,ci=TRUE)~Gender,
                                           data=UCBAdmissions)
     admissions <- aggregate(
             percent(Admit=="Admitted",weight=Freq,ci=TRUE)~Dept+Gender,
                                           data=UCBAdmissions)
     xyplot(cbind(Percentage,lower,upper)~Gender|Dept,data=admissions,
           panel=panel.errbars,
           ewidth=.2,pch=19,
           ylab="Percentage applicants admitted by Department")
     xyplot(cbind(Percentage,lower,upper)~Gender|Dept,data=applications,
           panel=panel.errbars,
           ewidth=.2,pch=19,
           ylab="Percentage applications to the Department")

