sscsample              package:Bolstad              R Documentation

_S_i_m_p_l_e, _S_t_r_a_t_i_f_i_e_d _a_n_d _C_l_u_s_t_e_r _S_a_m_p_l_i_n_g

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

     Samples from a fixed population using either simple random
     sampling, stratitified sampling or cluster sampling.

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

     sscsample(size, n.samples, sample.type="simple", x = NULL,
               strata = NULL, cluster = NULL, ret=FALSE, print = TRUE)

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

    size: the desired size of the sample

n.samples: the number of repeat samples to take

sample.type: the sampling method. Can be one of "simple", "stratified",
          "cluser" or 1, 2, 3 where 1 corresponds to "simple", 2 to
          "stratified" and 3 to "cluster"

       x: a vector of measurements for each unit in the population. By
          default x is not used, and the builtin data set
          sscsample.data is used

  strata: a corresponding vector for each unit in the population
          indicating membership to a stratum

 cluster: a corresponding vector for each unit in the population
          indicating membership to a cluster

     ret: if true then the samples, their means, and the numbers of
          observations from each stratum are returned as a list

   print: if false then the screen output will be supressed.

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

     If ret is true, then a list will be returned with the following
     components: 

 samples: a matrix with the number of rows equal to size and the number
          of columns equal to n.samples. Each column corresponds to a
          sample drawn from the population

s.strata: a matrix showing how many units from each stratum were
          included in the sample

   means: a vector containing the mean of each sample drawn

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

     James M. Curran, Dept. of Statistics, University of Waikato,
     Hamilton, New Zealand. Janko Dietzsch, Proteomics Algorithm and
     Simulation,Zentrum f. Bioinformatik Tuebingen Fakultaet f.
     Informations- und Kognitionswissenschaften, Universitaet Tuebingen

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

     'sscsample.data'

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

     ## Draw 200 samples of size 20 using simple random sampling
     sscsample(20,200)

     ## Draw 200 samples of size 20 using simple random sampling and store the
     ## results. Extract the means of all 200 samples, and the 50th sample
     res<-sscsample(20,200,ret=TRUE)
     res$means
     res$samples[,50]

