clt                   package:pad                   R Documentation

_P_A_D  -  _I_l_l_u_s_t_r_a_t_e_s _t_h_e _C_e_n_t_r_a_l _L_i_m_i_t _T_h_e_o_r_e_m

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

     Take samples of size n from a vector of data of size N and
     computes the empirical distribution of the sample mean,
     illustrating the central limit theorem.

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

     clt(x, n, nsim, plot = TRUE, ncols = 2)

     ## S3 method for class 'clt':
     plot(x, ...)

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

       x: a numeric vector with the data

       n: an integer defining the sample size

    nsim: an integer defining number of samples to be taken

    plot: logical. If 'TRUE' histograms are produced in the graphical
          device.  

   ncols: numerical. The number of columns in the graphical device.
          Only valid if 'plot = TRUE'. 

     ...: unused.

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

     Returns a list which is an object of the class  'clt'. The list
     components are:

    data: a vector with the data passed to the function

   sizeN: a list with vectors of averages ('xbar')  and standard
          deviations ('sd') of each sample


     For each sample size N provided there will be one component as the
     latter.

     \mbox{}

     The function 'hist.clt' plots histograms of the sample means on
     the current graphics device.

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

     Peter J. Diggle p.diggle@lancaster.ac.uk 
      Paulo Justiniano Ribeiro Jr. p.ribeiro@lancaster.ac.uk.

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

     clt(rexp(1000), c(2,4,8,16,32), 1000)
     #
     par.now <- par(no.readonly=TRUE)
     par(mfrow=c(3,2))
     data.clt <- clt(exp(rnorm(2000)), c(2,4,8,16,32), 1000, plot=FALSE)
     plot(data.clt)
     par(par.now)
     #
     # For an interactive input type:
     ## Not run: 
     clt()
     ## End(Not run)

