srswor               package:sampling               R Documentation

_S_i_m_p_l_e _r_a_n_d_o_m _s_a_m_p_l_i_n_g _w_i_t_h_o_u_t _r_e_p_l_a_c_e_m_e_n_t

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

     Draw a simple random sampling without replacement of size n (equal
     probabilities, fixed sample size, without replacement).

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

     srswor(n,N)

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

       n: sample size.

       N: population size.

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

     Return a vector (with elements 0 and 1) of size N, where N is the
     population size.   Each element k of this vector indicates the
     status of the unit k  (1, the unit k is selected in the sample; 0,
     otherwise).

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

     'sample', 'srswr'

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

     ############
     ## Example 1
     ############
     #select a sample
     s=srswor(3,10)
     #the sample is
     (1:10)[s==1]
     ############
     ## Example 2
     ############
     data(belgianmunicipalities)
     Tot=belgianmunicipalities$Tot04
     name=belgianmunicipalities$Commune
     n=200
     #select a sample
     s=srswor(n,length(Tot))  
     #the sample is 
     as.vector(name[s==1])

