

histogram(haerdle)                           R Documentation

_H_a_e_r_d_l_e_'_s _h_i_s_t_o_g_r_a_m _f_u_n_c_t_i_o_n

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

     computes and plots a histogram

_U_s_a_g_e_:

     histogram(data, h, x0, plot.type=T, ...)

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

     Required:

    data: a vector of data

       h: bin width

      x0: start of first bin

plot.type: If TRUE, plot the histogram

     ...: further options to barplot

_V_a_l_u_e_:

     If plot.type=F, a list of midpoint and est, the
     heights.

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

     `Smoothing Techniques with Implementation in S', Wolf-
     gang Haerdle, Springer, 1991

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

     `hist', `frequency.polygon', `histogram.normal.ref'

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

     data(buffalo)
     # Figure 1.9
     histogram(buffalo,10,0)

     # Figure 1.16
     par(mfrow=c(3,2))
     histogram(buffalo,10,0)
     histogram(buffalo,10,2)
     histogram(buffalo,10,4)
     histogram(buffalo,10,6)
     histogram(buffalo,10,8)
     grid <- 1+seq(20,138,2)
     est<-numeric(length(grid))
     for(i in seq(0,8,2)){
           cw <- histogram(buffalo,10,i,FALSE)
           est <- est+cw[[2]][(grid-i)%/%10]/5
     }
     barplot(est,grid[-1]-grid[-length(grid)],space=0,ylim=c(0,max(est)))
     box()

